Good Bye 2023
D
Mathematical Problem
Codeforces
1700
原题
← CE →
翻译中…

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 $\mathtt{234}$ and $\mathtt{432}$, and $\mathtt{11223}$ and $\mathtt{32211}$, the multisets of digits are the same, but for $\mathtt{123}$ and $\mathtt{112233}$, they are not.

翻译中…

The mathematicians couldn't solve this problem. Can you?

翻译中…

Input

翻译中…

The first line contains an integer $t$ ($1 \leq t \leq 100$) — the number of test cases.

翻译中…

The following $t$ lines contain one odd integer $n$ ($1 \leq n \leq 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 $n^2$ does not exceed $10^5$.

翻译中…

The numbers can be output in any order.

翻译中…

Output

翻译中…

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.

翻译中…

Note

翻译中…

Below are the squares of the numbers that are the answers for the second test case:

翻译中…

$\mathtt{169}$ = $\mathtt{13}^2$

翻译中…

$\mathtt{196}$ = $\mathtt{14}^2$

翻译中…

$\mathtt{961}$ = $\mathtt{31}^2$

翻译中…

Below are the squares of the numbers that are the answers for the third test case:

翻译中…

$\mathtt{16384}$ = $\mathtt{128}^2$

翻译中…

$\mathtt{31684}$ = $\mathtt{178}^2$

翻译中…

$\mathtt{36481}$ = $\mathtt{191}^2$

翻译中…

$\mathtt{38416}$ = $\mathtt{196}^2$

翻译中…

$\mathtt{43681}$ = $\mathtt{209}^2$

翻译中…

样例

Input #1
3
1
3
5
Output #1
1
169
196
961
16384
31684
36481
38416
43681
InputCopy OutputCopy
题目信息
题号
1916D
所属比赛
时间限制
1 s
内存限制
256 MB
标签
暴力
构造
计算几何
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。