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

27385번 - Birthday Gift 다국어

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

문제

It’s your Venusian friend’s birthday. You don’t remember their exact age, but you are sure it had to be no more than 10ドル^{18}$ years. You will give them a decimal number (without leading zeros) for their birthday. You want the number of digits to be equal to their age. To make the number more interesting you will ensure that no adjacent pairs of digits will be identical.

Their exact day of birth is represented as an integer in the range 0ドル$ to 224ドル$ (since Venus has 225ドル$ days in a year). To make their gift more personal you want the given number to have the same remainder as their birthday when divided by 225ドル$.

There are potentially a lot of possible gifts that you could give. You may decide to give more than one gift. Determine the number of possible gifts modulo 10ドル^9+7$.

입력

The single line of input contains two space separated integers $a$ (1ドル \le a \le 10^{18}$) and $b$ (0ドル \le b < 225$), where $a$ is the age of your friend and $b$ is the birthdate of your friend.

출력

Output a single integer, which is the number of interesting personalized numbers you could give. Since this number may be quite large, output it modulo 10ドル^9+7$.

제한

예제 입력 1

12345 200

예제 출력 1

323756255

예제 입력 2

100 87

예제 출력 2

896364174

예제 입력 3

100 35

예제 출력 3

785970618

예제 입력 4

5000 5

예제 출력 4

176058968

예제 입력 5

888888 88

예제 출력 5

906317283

예제 입력 6

9999999 99

예제 출력 6

133442170

예제 입력 7

101010101010 127

예제 출력 7

893501348

힌트

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2022 B번

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

출처

대학교 대회

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

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