#K39042. Minimum Steps to the Last Floor

    ID: 26332 Type: Default 1000ms 256MiB

Minimum Steps to the Last Floor

Minimum Steps to the Last Floor

You are given the total number of floors in a building and an array representing the number of steps required to move from one floor to the next. Specifically, if there are \(F\) floors, then the array will contain \(F-1\) integers. Your task is to calculate the minimum number of steps required to reach the last floor from the first floor. Formally, if the array is \(A\) with length \(F-1\), the answer is given by \(\sum_{i=1}^{F-1} A_i\).

This problem tests your ability to correctly process multiple test cases and perform simple summation operations, while reading from standard input (stdin) and outputting to standard output (stdout).

inputFormat

The input is read from stdin and has the following format:

  • The first line contains an integer \(T\), representing the number of test cases.
  • For each test case, the first line contains an integer \(F\), which represents the total number of floors in the building.
  • The next line contains \(F-1\) space-separated integers, where each integer denotes the number of steps required to move from one floor to the next.

outputFormat

For each test case, output a single integer that is the minimum number of steps required to reach the last floor. Each answer should be printed on a new line to stdout.

## sample
1
2
10
10

</p>