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

35005번 - Time of the Magical Number 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB42332875.676%

문제

Long ago, in the fairy kingdom of Time, there lived a kind wizard named Nikolay. He adored the magical number 239, which brought him luck and joy every time he saw it on the magical digital clock of the kingdom located at the main square.

This wonderful clock displayed time using four digits: two for the hours and two for the minutes. If the number of hours or minutes was less than 10ドル,ドル a 0ドル$ was placed in the front.

Nikolay can enchant time so that there will be $H$ hours in each day, numbered from 0ドル$ to $H - 1,ドル and $M$ minutes in each hour, numbered from 0ドル$ to $M - 1$. For this spell, Nikolay can select any numbers $H$ and $M$ between 10ドル$ and 100ドル,ドル inclusive.

The time shown by the clock is lucky only when the digits resemble the cherished combination 239:

  • When the clock shows X2:39, where the first digit X can take any value from 0 to 9.
  • Or 2X:39, where the digit X can take the value 0, 2, or 3 (because 0 does not hinder the perception of the magical number).
  • Or 23:X9, where the digit X can take the value 0, 3, or 9.
  • Or even 23:9X, where the digit X can take any value from 0 to 9.

One day, Nikolay faced the question: "Given $H$ and $M,ドル how many minutes in a full day will the clock show a lucky number?" Help Nikolay find this number.

입력

The first line of input contains two integers $H$ and $M$ separated by a space: the number of hours in a day and the number of minutes in an hour (10ドル \le H, M \le 100$).

출력

Output the number of minutes in a full day when the clock will show a lucky number.

제한

예제 입력 1

24 60

예제 출력 1

6

노트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2025-2026 Northwestern Russia Qualification B번

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

출처

대학교 대회

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

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