CF1916D.Mathematical Problem
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The mathematicians of the 31st lyceum were given the following task:
You are given an odd number n , and you need to find n different numbers that are squares of integers. But it's not that simple. Each number should have a length of n (and should not have leading zeros), and the multiset of digits of all the numbers should be the same. For example, for 234 and 432 , and 11223 and 32211 , the multisets of digits are the same, but for 123 and 112233 , they are not.
The mathematicians couldn't solve this problem. Can you?
输入格式
The first line contains an integer t ( 1≤t≤100 ) — the number of test cases.
The following t lines contain one odd integer n ( 1≤n≤99 ) — the number of numbers to be found and their length.
It is guaranteed that the solution exists within the given constraints.
It is guaranteed that the sum of n2 does not exceed 105 .
The numbers can be output in any order.
输出格式
For each test case, you need to output n numbers of length n — the answer to the problem.
If there are several answers, print any of them.
输入输出样例
输入#1
3 1 3 5
输出#1
1 169 196 961 16384 31684 36481 38416 43681
说明/提示
Below are the squares of the numbers that are the answers for the second test case:
169 = 132
196 = 142
961 = 312
Below are the squares of the numbers that are the answers for the third test case:
16384 = 1282
31684 = 1782
36481 = 1912
38416 = 1962
43681 = 2092