Distribute the Bars
시간 제한2초메모리 제한512 MB
처음 N개의 홀수를 같은 무게 합을 갖는 두 개 이상의 묶음으로 나누고, 불가능하면 -1을 출력합니다.
문제
There are metal bars. The weight of -th metal bar is .
Your task is to distribute those metal bars into two or more groups such that the sum of weights of metal bars in each group will be the same, or determine that it is impossible. Note that each metal bar must go to exactly one group, and that it is not allowed to cut the metal bars.
입력
The input contains one integer ().
출력
If there is no way to distribute the metal bars into two or more equally weighted groups, print one line containing the integer .
Otherwise, on the first line, print the number of groups (). Then print lines, one for each group. The -th of these lines must start with the the integer , the number of metal bars in the -th group. Then print integers: the weights of the metal bars in the group. Each metal bar must be assigned to exactly one group, and the sums of weights of the metal bars in all groups must be the same.
If there is more than one solution, print any one of them.