#C12396. Analyze Temperature Drops
Analyze Temperature Drops
Analyze Temperature Drops
You are given a list of daily temperature readings over a week. A sudden temperature drop is defined as a temperature decrease of at least $15$ degrees from one day to the next. That is, a drop between two consecutive days is sudden if $$T_i - T_{i+1} \ge 15.$$
Your task is to detect all instances of such drops. If one or more sudden drops occur, output each pair of consecutive temperatures (the previous day and the next day) on a separate line, with the two numbers separated by a single space. If no such drop occurs (or if there are fewer than two temperature readings), output exactly "No sudden drop".
inputFormat
The first line contains an integer (), representing the number of days. The second line contains space-separated integers which represent the recorded daily temperatures.
outputFormat
If one or more sudden drops are detected, print each corresponding pair on a separate line with the two temperatures separated by a space. Otherwise, print "No sudden drop".## sample
7
70 72 75 78 80 81 80
No sudden drop
</p>