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

21069번 - Joyful Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB196916240.523%

문제

We say that an integer $n \geq 1$ is joyful if, by concatenating the digits 25ドル$ to the right of $n,ドル we get a perfect square. For example, 2ドル$ is a joyful number (as 225ドル = 15^2$) but 3ドル$ is not (as 325ドル$ is not a perfect square).

Given an integer $k$ such that 1ドル \leq k \leq 10^9,ドル count the number of distinct prime factors of the $k$-th joyful number.

입력

The first line contains one integer $t,ドル the number of test cases (1ドル \leq t \leq 4 \cdot 10^3$).

Each test case is given on a separate line containing an integer $k$ (1ドル \leq k \leq 10^9$).

출력

For each test case, print a line with a single integer: the number of distinct prime factors of the $k$-th joyful number.

제한

예제 입력 1

2
1
4

예제 출력 1

1
2

예제 입력 2

1
1000000000

예제 출력 2

7

힌트

The first joyful number is 2ドル,ドル which has one distinct prime factor. The fourth joyful number is 20ドル = 2 \cdot 2 \cdot 5,ドル which has two distinct prime factors.

출처

Camp > Petrozavodsk Programming Camp > Winter 2021 > Day 2: UPC Contest J번

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

출처

대학교 대회

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

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