Title:
The-annoyance-of-the-productor Download
Description: Conductor troubles
Acceteped: 1705 Submit: 3924
Time Limit: 1000 MS Memory Limit: 65536 KB
Description
John is the webmaster of a small train station, he is very trouble each train regrouping. Turn inside out from the left because the right side of the station is only a grouping of chevron track (pictured), all train compartments are herringbone track. Marshalling the order of John editor-in-chief but not out, John suspected some grouping order is impossible, John could not find those order can marshalling those who can not. You write a program to help John to identify which grouping can be done, what can not be completed.
Input:
The first line is an integer K, the number of test cases, each subsequent line of a test case, every behavior n integer, an integer n represents the number of cars behind n integers need grouped order. For example, three cars, in accordance with 1, 2, 3, in turn orbit grouping, formed in the left 12 3,1 3 2,2 3,2 3 1,321.
Output:
To Search:
File list (Check if you may need any files):
The annoyance of the productor.txt