#K95137. Minimum Breaks Required

    ID: 38797 Type: Default 1000ms 256MiB

Minimum Breaks Required

Minimum Breaks Required

You are given a work schedule divided into N consecutive work periods. In order to ensure productivity, you plan to take a break between two consecutive work periods. However, if there is only one work period (or none), no break is required.

Your task is to calculate the minimum number of breaks required for each test case. Formally, if there are N work periods, then the number of breaks is given by $$B = \max(0, N-1)$$.

Input Example: For a schedule with 3 work periods, the answer is 2 breaks, since breaks are taken between the periods.

Note: The duration of each work period is provided but is not used in determining the number of breaks.

inputFormat

The first line contains an integer T, representing the number of test cases. Each test case is described as follows:

  • The first line of each test case contains an integer N, the number of work periods.
  • The second line contains N space-separated integers, each representing the duration (in hours) of a work period. If N is 0, this line may be empty.

outputFormat

For each test case, output a single integer on a new line, which is the minimum number of breaks required.

## sample
2
3
4 3 2
2
6 7
2

1

</p>