Logo
(追記) (追記ここまで)

30613번 - Weather Trends 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
20 초 (추가 시간 없음) 1024 MB28171376.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.

제한

예제 입력 1

10
6
30 28 30 29 32 26 27 30 28 33

예제 출력 1

7.000000

예제 입력 2

7
3
31 32 33 25.91 31 30 35

예제 출력 2

5.090000

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > Greek Collegiate Programming Contest > GRCPC 2023 5번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /