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

20220번 - Human Pyramid 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2.5 초 512 MB81454256.000%

문제

The Barefooted Acrobatics People's Club wants to make a group photo in an original way. For the photo, they want to make a human pyramid, where each person rests on the ground or rests on the shoulders of two people below him or her.

Making a human pyramid demands a lot from the acrobats involved, so the club selected a group consisting of strong people of which they are assured that these people can carry enough weight. The others are 'agile' and to make sure everyone is comfortable during the photo, there can only be agile people directly above an agile person.

The photographer wants to make a photo of a pyramid with $h$ people on the floor, $h-1$ on the second layer, $h-2$ on the third layer, and so on, with a single person on the $h$th layer. You have $s$ strong people at your disposal, and the other $\frac12 h (h+1) - s$ people are agile. What is the number of ways you can arrange the pyramid satisfying the demands of the photographer? Since this number may be large, you should find it modulo 10ドル^9 + 7$.

Two pyramids $P_1$ and $P_2$ are different if there exists a location where $P_1$ has an agile person and $P_2$ a strong person, or vice versa.

입력

The input consists of:

  • A line containing two integers $h$ (1ドル \leq h \leq 100$) and $s$ (0ドル \leq s \leq \frac{1}{2} h (h + 1)$), the number of layers in the pyramid and the number of strong people.

출력

Output the number of possible ways to build a pyramid with the given constraints, modulo 10ドル^9 + 7$.

제한

예제 입력 1

3 3

예제 출력 1

3

예제 입력 2

5 3

예제 출력 2

14

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2020 Preliminaries H번

  • 문제를 만든 사람: Ludo Pulles
(追記) (追記ここまで)

출처

대학교 대회

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

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