| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 20 초 (추가 시간 없음) | 1024 MB | 28 | 17 | 13 | 76.471% |
George is an aspiring meteorologist who is passionate about analyzing temperature data. He is tasked with finding the largest temperature increase that occurs within specific time frames. Your task is to help George develop an efficient algorithm to calculate such temperature increases for any time interval.
Given a sequence of daily temperature measurements over a period of n days, George is interested in finding the greatest temperature increase that occurs within a window of m days. In other words, he wants to identify the maximum temperature difference between two days, where the second day occurs no more than m days after the first one.
The first line of input contains a single integer n, representing the number of available temperature measurements. The second line contains a single integer m, indicating the maximum time interval in days. The third line contains n temperature values, separated by spaces.
Output a single real number, representing the maximum temperature increase that occurs within the specified m-day interval.
Your task is to implement an efficient algorithm that can solve this problem for George. Additionally, ensure that your output has an absolute or relative error of at most 10-6.
10 6 30 28 30 29 32 26 27 30 28 33
7.000000
7 3 31 32 33 25.91 31 30 35
5.090000