#P12313. Bank Savings with Daily Interest
Bank Savings with Daily Interest
Bank Savings with Daily Interest
In this problem, a person named Xiao Lan deposits money in a bank. The bank gives a daily interest of \(0.005\%\) on the account balance from the previous day. The interest is calculated using the balance at the end of the previous day, which is added at the beginning of the next day before performing that day’s transactions. The balance is maintained with a minimum unit of \(0.01\) yuan (i.e. 1 fen), and any interest less than \(0.01\) yuan is ignored.
You are given the deposit/withdrawal record of \(M\) days. Initially, the balance is \(0\) yuan. It is guaranteed that at any moment a withdrawal will not exceed the current balance.
Your task is to compute and output the account balance at the end of each day. Note that after the first day, every day begins by adding the interest calculated on the previous day's ending balance. The interest is computed as follows:
[ \text{interest} = \left\lfloor \text{balance}_{prev} \times 0.00005 \times 100 \right\rfloor / 100 ]
Here, \(\lfloor x \rfloor\) represents the floor function, which rounds \(x\) down to the nearest integer.
inputFormat
The first line contains a single integer \(M\) (\(1 \leq M \leq 10^5\)), which represents the number of days. The following \(M\) lines each contain a decimal number with exactly two digits, representing the deposit (a positive number) or withdrawal (a negative number) for that day.
outputFormat
Output \(M\) lines. The \(i\)-th line should contain the account balance at the end of day \(i\), formatted as a decimal number with exactly two digits.
sample
3
1000.00
-500.00
200.00
1000.00
500.05
700.07
</p>