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

8977번 - DISPLEJ 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB36022919365.646%

문제

The game "display" is gaining popularity in casinos around the world. The game is run on a big screen visible to all players. A single integer is displayed on the screen, which changes every minute.

The players attempt to determine the sum of K consecutive numbers, starting from the B-th displayed number. More precisely, if Xn is the n-th number displayed (starting with X1), then players try to determine the sum XB + XB+1 + ... + XB+K−1.

Mirko is thrilled with this game and often spends five or six hours calculating sums and growing in debt. Recently he realized that the numbers on screen follow a precise pattern; the same sequence of N integers repeats over and over.

Help Mirko to find the sought sum, given the sequence of number repeating.

입력

The first line contains three integers N, K and B, 1 ≤ N ≤ 100, 1 ≤ K ≤ 100, 1 ≤ B ≤ 109.

The second line contains N non-negative integers less than 100, separated by spaces. This is the sequence that keeps repeating on screen.

출력

Output the sum on a single line.

제한

예제 입력 1

6 3 10
29 6 35 0 6 8

예제 출력 1

14

예제 입력 2

5 7 154
1 2 3 4 5

예제 출력 2

24

예제 입력 3

2 100 100000
1 0

예제 출력 3

50

힌트

In the first example, the tenth number displayed is 0, followed by 6 and 8. The sum is 14.

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2008 > Regional Competition - Seniors 1번

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

출처

대학교 대회

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

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