~/algor $ cat problems/eng-past-qoldiq
Lowest balance
An account initially holds $0$ soums. $n$ operations were performed one after another: a positive number means money came into the account, a negative number means money was withdrawn (the balance may also become negative, which is a debt). Among the balances after each operation, find the lowest one and the number of the operation after which it occurred. The initial $0$ also counts (its operation number is $0$). If the lowest balance occurs several times, take the first one.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers — the operations.
Output
Two integers separated by a space: the lowest balance and the operation number.
Note
$1 \le n \le 10^{5}$
each operation is from $-10^{9}$ to $10^{9}$
Examples
6 500 -700 300 -400 -200 1000
-500 5
3 100 200 -50
0 0