luogu#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 or , moreover if one family receives a cubes and another family in the same year receives cubes then a should not be divisible by 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 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 -- the number of years to come . Each of the following lines contains a single integer -- the number of cubes to distribute in i-th year
输出格式
For each year output two lines. The first line should contain -- the number of families that would receive at least one cube in i-th year . The second line should contain integers -- the number of cubes received by each family. The sum of these numbers should be equal to
题目大意
在一个叫做 镁铊铬铌氩 的国度中,有个贵族家庭。
每年,这些贵族家庭都要收到来自先知之首的若干个典礼用的小方块。先知有一些分配小方块的规则:
-
如果某年有一个家庭收到了小方块,那么这个家庭所收到的小方块的个数的质因数只能是和。
-
如果某年有一个家庭收到了个小方块,同年另一个家庭收到了个小方块,那么不整除,也不整除。
现在,你作为先知之首,你知道你接下来的年中,你每年有多少个小方块。你现在想要找到任意一个可行的方案,以便在接下来年中能够进行按规则分配。
第一行,包含一个正整数。
接下来有行,每行有一个正整数,表示在第年中,你可以用于支配的小方块个数。
对于每年输出两行。第一行应包含一个数,表示能够收到小方块的家庭的数目。
第二行有个整数,代表每个家庭应该收到的小方块的个数。这些整数之和应该等于。
时间限制:
空间限制:
翻译提供:@Trexmao
4
1
2
3
10
1
1
1
2
1
3
2
4 6
提示
Time limit: 2 s, Memory limit: 256 MB.