#K38657. Minimum Initial Skill Calculation

    ID: 26247 Type: Default 1000ms 256MiB

Minimum Initial Skill Calculation

Minimum Initial Skill Calculation

In this problem, you are given several test cases where for each test case you have a number of blocks. Each block has an associated difficulty level. Your task is to determine the minimum initial skill level required to stack all the blocks in the given order. The required skill level for a test case is simply the sum of the block difficulties. In mathematical terms, if a test case consists of n blocks with difficulties (a_1, a_2, \dots, a_n), then the minimum initial skill level (S) is given by

[ S = \sum_{i=1}^{n} a_i ]

Ensure that your program reads input from the standard input and writes output to the standard output.

inputFormat

The first line of input contains an integer (T) representing the number of test cases. This is followed by (T) lines, each describing a test case. Each test case starts with an integer (n) indicating the number of blocks, followed by (n) integers representing the difficulty levels of each block.

outputFormat

For each test case, output a single line containing the minimum initial skill level required (i.e., the sum of the block difficulties).## sample

2
3 3 2 5
4 1 1 1 1
10

4

</p>