|
||||||||||
Find the maximumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2413 Accepted Submission(s): 1025 Problem Description Euler's Totient function, ¦Õ (n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n . For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, ¦Õ(9)=6. HG is the master of X Y. One day HG wants to teachers XY something about Euler's Totient function by a mathematic game. That is HG gives a positive integer N and XY tells his master the value of 2<=n<=N for which ¦Õ(n) is a maximum. Soon HG finds that this seems a little easy for XY who is a primer of Lupus, because XY gives the right answer very fast by a small program. So HG makes some changes. For this time XY will tells him the value of 2<=n<=N for which n/¦Õ(n) is a maximum. This time XY meets some difficult because he has no enough knowledge to solve this problem. Now he needs your help. Input There are T test cases (1<=T<=50000). For each test case, standard input contains a line with 2 ¡Ü n ¡Ü 10^100. Output For each test case there should be single line of output answering the question posed above. Sample Input
Sample Output
Hint If the maximum is achieved more than once, we might pick the smallest such n. Source | ||||||||||
|