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

23788번 - Screamers in the Storm 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB40252475.000%

문제

On Mars, though its atmosphere is very thin, winds can blow with unexpected force. The effect can grow even stronger in narrow and deep canyons close to the equator. The floor of one of these canyons is extremely flat and it is used for transport because its steep walls provide partial shielding from cosmic radiation. Over the time, sand has accumulated in the canyon. It is blown by the wind into sizeable sand dunes which obstruct the transport. The dunes form one long string of dunes stretched along the canyon floor.

The arrangement of the dunes is not stable. Raging sand storms often remodel the dunes into a different string. Violent movement of sand masses in the storm produce an eerie sound for which the dunes are known as ”Screamers in the storm”.

Detailed measurements of the dunes revealed that the height of adjacent dunes, expressed in Martian meters, is always a small positive integer. Moreover, probably due to wind interference effects in the canyon, the heights of two adjacent dunes are different, unless they are both 1. In fact, the heights of two adjacent dunes are always relatively prime, that is, they share no common factor bigger than 1.

To model the dunes behavior, the number of all possible configurations of the dunes in the string has to be established.

입력

The input contains one line with two integers K, N (1 ≤ K ≤ 66, 1 ≤ N ≤ 1018), the maximum possible height of a dune and the number of dunes in the string of dunes.

출력

Print the number of different strings of dunes. Output the result modulo 109 + 7.

제한

예제 입력 1

3 4

예제 출력 1

41

예제 입력 2

2 4

예제 출력 2

8

예제 입력 3

42 75097099101114

예제 출력 3

673977658

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CTU Open Contest > CTU Open Contest 2021 S번

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

출처

대학교 대회

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

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