#K48147. Beautiful Buildings

    ID: 28356 Type: Default 1000ms 256MiB

Beautiful Buildings

Beautiful Buildings

You are given several test cases. In each test case, you have a sequence of buildings represented by their heights. A building is considered beautiful if it is strictly taller than every building to its left. Formally, for a building at index \(i\) (1-indexed) with height \(h_i\), it is beautiful if:

[ h_i > \max_{1 \leq j < i} h_j ]

Note that the first building in any test case is always considered beautiful.

Your task is to determine, for each test case, the number of beautiful buildings.

inputFormat

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

T
N_1
h_1 h_2 ... h_{N_1}
N_2
h_1 h_2 ... h_{N_2}
... 
N_T
h_1 h_2 ... h_{N_T}

Where:

  • T is the number of test cases.
  • For each test case, the first line contains an integer N representing the number of buildings.
  • The following line contains N space-separated integers representing the heights of the buildings. If N is 0, no line of heights is provided.

outputFormat

For each test case, output a single integer on a new line representing the number of beautiful buildings in that test case.

## sample
1
4
3 7 8 3
3

</p>