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

30563번 - Fast Forward 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB40181747.222%

문제

Gry has started to use the new Expify song streaming platform. Since, Gry does not want to spend money Expify forces him to listen to advertisements. An advertisement can be played only after some song (it cannot be played in the middle) and only if the time from the end of the previous advertisement is at least $c$ seconds.

Gry has a circular playlist with $n$ songs where the duration of the $i$-th song is $d_i$ seconds. He wants to minimize the number of advertisements, so, he wants to find out how many advertisements will be if he starts listening to his whole playlist from $i$-th song, i.e., the circular playlist stops playing after $n$ songs.

We suppose that there is an advertisement right before Gry starts listening. Neither this advertisement nor the one, after the playlist stops, count.

입력

  • One line containing the number of songs in the playlist $n,ドル and the refresh time between advertisements $c$ (1ドル \leq n \leq 10^6,ドル 1ドル \leq c \leq 10^9$)
  • One line containing the $n$ durations of the songs $d_1 \ldots d_n$ (1ドル \leq d_i \leq 10^3$)

출력

Output the number of advertisements if Gry starts listening to the playlist from the $i$-th song.

제한

예제 입력 1

7 7
1 1 1 1 1 1 1

예제 출력 1

0 0 0 0 0 0 0

예제 입력 2

3 3
1 1 3

예제 출력 2

0 1 1

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2023 F번

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

출처

대학교 대회

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

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