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 nn , and you need to find nn different numbers that are squares of integers. But it's not that simple. Each number should have a length of nn (and should not have leading zeros), and the multiset of digits of all the numbers should be the same. For example, for 234\mathtt{234} and 432\mathtt{432} , and 11223\mathtt{11223} and 32211\mathtt{32211} , the multisets of digits are the same, but for 123\mathtt{123} and 112233\mathtt{112233} , they are not.

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

输入格式

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

The following tt lines contain one odd integer nn ( 1n991 \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 n2n^2 does not exceed 10510^5 .

The numbers can be output in any order.

输出格式

For each test case, you need to output nn numbers of length nn — 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\mathtt{169} = 132\mathtt{13}^2

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

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

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

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

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

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

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

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

首页