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

7118번 - Ones 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB125674652.874%

문제

The form of a natural number a in a number system with base p contains of n ones (digts "1") in a row.

Your task is to write a program that computes the greatest values of exponents of numbers 2 and 3 such that the remainder of a divided by both these values the remainder is 0.

입력

Two values of natural numbers p (1 < p < 109) and n (n < 109) are input from the keyboard.

출력

Two non-negative integer numbers must be output on the screen: the values of the greatest exponents of two and three.

제한

예제 입력 1

17 2

예제 출력 1

1 2

예제 입력 2

10 4

예제 출력 2

0 0

힌트

출처

Olympiad > Latvian olympiad in informatics > 11th Latvian olympiad in informatics > Stage III (Country) 3번

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

출처

대학교 대회

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

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