#K45457. Identifying Temperature Spikes
Identifying Temperature Spikes
Identifying Temperature Spikes
You are given multiple test cases. In each test case, an integer N and a list of N integers representing the temperatures on consecutive days are provided. A day is considered to have a sudden spike if its temperature is at least 5 degrees higher than that of the previous day. Note that the first day is not considered since it has no preceding day.
Your task is to find and output the 1-indexed positions of the days with sudden spikes. If no day satisfies the condition, output None
.
The spike condition can be expressed in LaTeX as follows:
$$ T_i \geq T_{i-1} + 5 $$
inputFormat
The input begins with an integer T (T > 0) indicating the number of test cases. Each test case consists of two lines. The first line contains an integer N (the number of days). The second line contains N space-separated integers representing the temperatures.
outputFormat
For each test case, output a single line containing the 1-indexed positions of the days where a temperature spike occurs, separated by spaces. If no day meets the condition for a test case, output None
.
7
5
10 15 20 13 18
3
10 15 10
4
5 5 5 5
2
1 6
3
1 2 7
6
1 2 7 12 1 6
4
10 10 15 25
2 3 5
2
None
2
3
3 4 6
3 4
</p>