시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 560 | 449 | 412 | 79.845% |
For this problem you will compute various running sums of values for positive integers.
The first line of input contains a single integer P, (1 ≤ P ≤ 10000), which is the number of data sets that follow. Each data set should be processed identically and independently.
Each data set consists of a single line of input. It contains the data set number, K, followed by an integer N, (1 ≤ N ≤ 10000).
For each data set there is one line of output. The single output line consists of the data set number, K, followed by a single space followed by three space separated integers S1, S2 and S3 such that:
3 1 1 2 10 3 1001
1 1 1 2 2 55 100 110 3 501501 1002001 1003002