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

20600번 - Lower Algorithmics 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 512 MB2410888.889%

문제

You are given a set $A$ of integers from 1ドル$ to 1000ドル$ inclusive. Your task is to find the number of positive integers that can be represented as a sum of several elements of $A,ドル with number of summands being from $\ell$ to $r$ inclusive. Equal summands are allowed. Note that each number is counted only once, even if it has several such representations.

입력

The first line of the input contains three space-separated integers: $n,ドル the number of elements in $A$ (1ドル \leq n \leq 1000$), followed by $\ell$ and $r,ドル the bounds on number of summands (1ドル \leq \ell \leq r \leq 2000$). The second line contains $n$ space-separated integers $a_1, a_2, \ldots, a_n$ (1ドル \leq a_1 < a_2 < \ldots < a_n \leq 1000$): the elements of the set $A$ in increasing order.

출력

Output the number of integers that are representable as a sum of elements of $A,ドル with number of summands being between $\ell$ and $r$.

제한

예제 입력 1

2 1 2
1 2

예제 출력 1

4

예제 입력 2

3 1 3
1 3 10

예제 출력 2

18

예제 입력 3

6 3 5
1 2 3 4 5 6

예제 출력 3

28

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2020 > Day 2: SPb SU LOUD ENOUGH Contest L번

Contest > Open Cup > 2020/2021 Season > Stage 2: SPb SU LOUD ENOUGH Contest L번

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

출처

대학교 대회

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

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