PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000188. Những số yêu thích của Ringo 3
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Những số yêu thích của Ringo 3
Ringo's Favorite Numbers 3
Source: AtCoder ABC400 E
Version: Phuoc Hung OJ Extended (one dataset per execution; batched queries remain together).
Problem Statement
A positive integer is a 400-number if it has exactly two distinct prime factors and every prime factor has an even exponent. For each of queries , find the largest 400-number not exceeding . The answer always exists.
Input
The first line contains . Each of the following lines contains an integer .
Output
Print one answer per query, each on its own line.
Subtasks
- Subtask 1 (20 points): và .
- Subtask 2 (30 points): và .
- Subtask 3 (50 points): và .
Sample Input
5
404
36
60
1000000000000
123456789
Sample Output
400
36
36
1000000000000
123454321
Sample Explanation
satisfies both conditions; do not, so the answer to is .