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

10742번 - PROSJEK 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB2501249649.741%

문제

You are given an array of N integers. Find a consecutive subsequence of numbers of the length at least K that has the maximal possible average.

Please note: the average of a subsequence is the sum of all the numbers in the subsequence divided by its length.

입력

The first line of input contains two integers N (1 ≤ N ≤ 3·105) and K (1 ≤ K ≤ N). The second line of input contains N integers ai (1 ≤ ai ≤ 106).

출력

The first and only line of output must contain the maximal possible average. An absolute deviation of ±0.001 from the official solution is permitted.

제한

예제 입력 1

4 1
1 2 3 4

예제 출력 1

4.000000

예제 입력 2

4 2
2 4 3 4

예제 출력 2

3.666666

예제 입력 3

6 3
7 1 2 1 3 6

예제 출력 3

3.333333

힌트

출처

Contest > Croatian Open Competition in Informatics > COCI 2014/2015 > Contest #7 5번

  • 데이터를 추가한 사람: orihehe
(追記) (追記ここまで)

출처

대학교 대회

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

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