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

27354번 - NoM 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.2 초 1024 MB52191937.255%

문제

Marcel has recently taken up a new hobby: creating zen gardens. He quickly developed his own style, that uses 2ドルN$ stones as garden features. Half of the stones are green (they are covered in moss) and are uniquely numbered from 1ドル$ to $N,ドル while the other half are grey (no moss grows on them) and are likewise uniquely numbered from 1ドル$ to $N$. To create a garden, Marcel will take the stones and place them in some order in a straight line, making sure the distance between any two consecutive stones is precisely 1ドル$ inch.

When it comes to judging the aesthetic appeal of a garden, all gardens are considered beautiful. However, there is one superstition that Marcel has about his gardens: if the distance between two stones that have the same number written on them is equal to a multiple of $M$ inches, then the garden is considered $M$-unlucky, bringing great misfortune and Code::Blocks crashes upon the one who created that garden. Marcel will never create such a garden. Naturally, all other gardens are considered $M$-lucky.

As part of his journey to reach enlightenment, Marcel has set out to create all the $M$-lucky gardens that can be created. However, as he is also a forethoughtful and well organized individual, Marcel would like to know how many $M$-lucky gardens consisting of 2ドルN$ stones exist before he embarks on his journey. Two gardens $A$ and $B$ are considered different if there exists an integer $i,ドル 1ドル ≤ i ≤ 2N,ドル such that:

  • the colour of the $i$th stone in garden $A$ is different from the colour of the $i$th stone in garden $B,ドル or
  • the number written on the $i$th stone in garden $A$ is different from the number written on the $i$th stone in garden $B$.

입력

The first and only line of the input contains two integers $N$ and $M,ドル meaning that Marcel will create gardens with 2ドルN$ stones which are $M$-lucky.

출력

On a single line, output the number of $M$-lucky gardens that contain 2ドルN$ stones, modulo 10ドル^9 + 7$.

제한

  • 1ドル ≤ M ≤ N ≤ 2,000円$

서브태스크

번호배점제한
19

1ドル ≤ N, M ≤ 5$

212

1ドル ≤ N, M ≤ 100$

313

1ドル ≤ N, M ≤ 300$

418

1ドル ≤ N, M ≤ 900$

548

No further restrictions

예제 입력 1

100 23

예제 출력 1

171243255

예제 입력 2

1 1

예제 출력 2

0

힌트

In the second example, two gardens can be created. However, no garden is 1ドル$-lucky, as for both gardens the distance between the stones numbered with 1ドル$ is 1ドル$ inch, which is a multiple of $M = 1$ inches.

출처

Olympiad > Romanian Master of Informatics > Romanian Master of Informatics 2021 4번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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