Pro.ID21660 TitleSquare Number Again Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21660 AC0 Submit0 Ratio- 时间&空间限制描述Square number is very popular in ACM/ICPC. Now here is a problem about square number again. Let's consider such a kind of number called K-Omitted-Square-Number (K-OSN). N is a K-OSN if: (1) It is a square number. (2) Its last digit is not 0. (3) It's not less than 10K. (4) If its last K digits are omitted, it's still a square number. Now, given an even number K, you have to find the largest K-OSN. 输入There are multiple test cases in this problem. The first line will contain a single positive integer T ( T ≤ 20 ) indicating the number of test cases. Each test case will be a single line containing an even number K ( 2 ≤ K ≤ 200 ). 输出Description Square number is very popular in ACM/ICPC. Now here is a problem about square number again. Let's consider such a kind of number called K-Omitted-Square-Number (K-OSN). N is a K-OSN if: (1) It is a square number. (2) Its last digit is not 0. (3) It's not less than 10K. (4) If its last K digits are omitted, it's still a square number. Now, given an even number K, you have to find the largest K-OSN. Input There are multiple test cases in this problem. The first line will contain a single positive integer T ( T ≤ 20 ) indicating the number of test cases. Each test case will be a single line containing an even number K ( 2 ≤ K ≤ 200 ). Output For each test case, print a single line containing the largest K-OSN. In case that it will be very large, you just need to print the number modulo 2009. If there are no K-OSN, or if the largest K-OSN doesn't exist, print "Oops!" (without quotes). Sample Input 1 Sample Output 197 Source 样例输入1 样例输出197 作者 |