#K47927. Cumulative Sum Sequence
Cumulative Sum Sequence
Cumulative Sum Sequence
Given an integer \( N \), generate a sequence of cumulative sums where the \( i \)-th element is defined as \( S_i = \sum_{j=1}^{i} j \). If \( N \leq 0 \), the sequence should be empty. This sequence is widely used in problems related to arithmetic progression sums.
inputFormat
An integer N provided via stdin. It represents the number of elements in the sequence.
outputFormat
A list of integers representing the cumulative sum sequence. The output should be printed to stdout in the format shown in the examples.## sample
1
[1]
</p>