#K12216. Running Total Calories
Running Total Calories
Running Total Calories
You are given a sequence of meals, where each meal is represented by a calorie count. Your task is to compute the cumulative sum (or running total) after each meal. The running total after the \(i\)-th meal is given by the formula: \(S_i = \sum_{j=1}^{i} a_j\), where \(a_j\) is the calorie count of the \(j\)-th meal.
For example, if the input calories are [200, 300, 100, 400], then the running totals are [200, 500, 600, 1000].
inputFormat
The first line of input contains a single integer \(n\) representing the number of meals. The second line contains \(n\) space-separated integers, where each integer indicates the calorie count for a meal.
outputFormat
Output a single line with \(n\) space-separated integers. Each integer must be the running total of calories up to that meal.
## sample4
200 300 100 400
200 500 600 1000