BSSPC '22 P1 - Bubble Tea Tracker

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

For a hackathon, your team is building an app that tracks the user's spending on bubble tea throughout the month! (In order to improve the financial literacy of high school students, supposedly.)

The user of your app makes N bubble tea purchases, the i^\text{th} costing x_i dollars.

After each purchase, your program must calculate the total the user has spent on bubble tea up until that point.

Constraints

1 \le N \le 100

1 \le x_i \le 100

Input Specification

The first line contains a single integer, N.

The next N lines contain one integer each, the i^\text{th} being x_i.

Output Specification

Output N lines containing one integer each, representing the total the user has spent on bubble tea after each of the purchases.

Sample Input

3
1
2
3

Sample Output

1
3
6

Explanation

The user makes 3 purchases.

After the first purchase, the user has spent 1 dollar on bubble tea.

After the second purchase, the user has spent 1 + 2 = 3 dollars on bubble tea.

After the third purchase, the user has spent 1 + 2 + 3 = 6 dollars on bubble tea.


Comments

There are no comments at the moment.