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

21636번 - Multiple Subject Lessons 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB42252156.757%

문제

Kate's school has introduced multiple subject lessons.

The students have the following task for the lesson of Math, Art and Sociology in the seventh grade. They are given an integer $n$. Each student has a set of $k$ colored pencils, let the colors be numbered from 1ドル$ to $k$. Each students takes a sheet of paper and writes down one or several integers at it, so that their sum was equal to $n$. Each integer is written using one of the pencils, so it has one of the $k$ possible colors.

The students must agree to do the task in such way that no two students have the same solution. Two solutions are the same if for each integer $a$ and each color $i$ the number of integers $a$ of color $i$ at students' sheets is the same.

The teacher of Math is sure that the students will be able to complete the task. However, she wants to know how many solutions are there, maybe there are not enough for all the students to have different solutions. Help her to find that out!

입력

The input contains two integers $n$ and $k$ (1ドル \le n, k \le 15$).

출력

Print one integer --- the number of solutions to the task.

제한

예제 입력 1

3 2

예제 출력 1

10

힌트

The following picture shows all possible ways to solve the task in the first sample test. Note that the order of integers written doesn't matter, only the number of integers written with each color.

출처

Olympiad > Russian Olympiad in Informatics > Russia Team High School Programming Contest > Russia Team High School Programming Contest 2020 D번

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

출처

대학교 대회

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

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