#P7051. [NWRRC2015] Distribution in Metagonia

[NWRRC2015] Distribution in Metagonia

题目描述

There are one hundred noble families in the country of Metagonia, and each year some of these families receive several ritual cubes from the Seer of the One. The One has several rules about cube distribution: if a family receives at least one cube, every prime divisor of the number of cubes received should be either 22 or 33 , moreover if one family receives a >0> 0 cubes and another family in the same year receives b>0b > 0 cubes then a should not be divisible by bb and vice versa.

You are the Seer of the One. You know in advance how many cubes would be available for distribution for the next tt years. You want to find any valid distribution of cubes for each of these years. Each year you have to distribute all cubes available for that year.

输入格式

The first line of input file contains a single integer tt -- the number of years to come (1t1000)(1 \le t \le 1000) . Each of the following tt lines contains a single integer nin_{i} -- the number of cubes to distribute in i-th year (1ni1018).(1 \le n_{i} \le 10^{18}).

输出格式

For each year ii output two lines. The first line should contain mim_{i} -- the number of families that would receive at least one cube in i-th year (1mi100)(1 \le m_{i} \le 100) . The second line should contain mim_{i} integers -- the number of cubes received by each family. The sum of these numbers should be equal to ni.n_{i}.

题目大意

在一个叫做 镁铊铬铌氩(Metagonia) (Metagonia) 的国度中,有100100个贵族家庭。

每年,这些贵族家庭都要收到来自先知之首的若干个典礼用的小方块。先知有一些分配小方块的规则:

  1. 如果某年有一个家庭收到了小方块,那么这个家庭所收到的小方块的个数的质因数只能是2233

  2. 如果某年有一个家庭收到了a>0a>0个小方块,同年另一个家庭收到了b>0b>0个小方块,那么aa不整除bbbb也不整除aa

现在,你作为先知之首,你知道你接下来的tt年中,你每年有多少个小方块。你现在想要找到任意一个可行的方案,以便在接下来tt年中能够进行按规则分配。


第一行,包含一个正整数t(1t1000)t(1≤t≤1000)

接下来有tt行,每行有一个正整数ni(1ni1018)n_i(1≤n_i≤10^{18}),表示在第ii年中,你可以用于支配的小方块个数。


对于每年输出两行。第一行应包含一个数mim_i,表示能够收到小方块的家庭的数目。

第二行有mim_i个整数,代表每个家庭应该收到的小方块的个数。这些整数之和应该等于nin_i


时间限制:2s2s

空间限制:256MB256MB

翻译提供:@Trexmao

4
1
2
3
10

1
1
1
2
1
3
2
4 6

提示

Time limit: 2 s, Memory limit: 256 MB.