#C3780. Badge Distribution
Badge Distribution
Badge Distribution
You are given T test cases. Each test case describes the scores of a series of participants in a contest. For each test case, you need to determine the number of participants who will receive a badge.
A participant receives a badge if their score is strictly greater than all scores encountered before. In mathematical terms, if the current score \(s\) is greater than the maximum of all previously seen scores \(\max_{previous}\), then the participant gets a badge.
For example, given scores [1, 2, 3, 2, 5]
, the badges are awarded for scores 1, 2, 3, and 5 (since each is a new maximum). Hence, the answer is 4.
inputFormat
The input is given via standard input and has the following format:
T n1 s1 s2 ... sn1 n2 s1 s2 ... sn2 ...
Where:
T
is the number of test cases.- For each test case, the first line contains an integer
n
denoting the number of participants, and the next line containsn
space-separated integers representing the scores.
outputFormat
For each test case, output a single integer on a new line representing the number of participants who will receive a badge.
## sample5
5
1 2 3 2 5
4
1 2 3 4
1
10
5
4 4 4 4 4
6
1 2 3 4 5 6
4
4
1
1
6
</p>