#C4673. Detecting Outbreak Days
Detecting Outbreak Days
Detecting Outbreak Days
You are given daily infection counts for several locations. For each location, your task is to determine the outbreak day. An outbreak day is defined as the first day (with 1-indexed numbering) on which the infection count is strictly greater than the maximum infection count of all previous days. In other words, for a sequence \(a_1, a_2, \dots, a_m\), you need to find the smallest index \(i\) such that \(i > 1\) and \(a_i > \max\{a_1, a_2, \dots, a_{i-1}\}\). If no such day exists, output -1.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains an integer \(L\), the number of locations.
- For each location, there is one line that begins with an integer \(m\) representing the number of days, followed by \(m\) non-negative integers denoting the daily infection counts.
outputFormat
For each location, output one line containing a single integer: the 1-indexed outbreak day if one exists, or -1 if there is no outbreak day.
## sample1
1 1
-1