Forced by students' parents, ZCC's teacher GPS has to open the scoreboard of the students. But this will bring many problems. So GPS intends only to open the first k ranklists of the tests. In order to avoid the arrogancy and the abandonment, GPS wants to make the difference between the highest ranking sum and the lowest ranking sum as small as possible.
At the same time, in order to reflect that each student is different, GPS defines the Progress Index.Progress Index exists between two exams. For two adjacent examinations, define NewRank as the ranking of the latter test, OldRank as the ranking of the formal one, and n as the number of students in the class.
ProgressIndex=
0,if NewRank=OldRank
OldRank-NewRank-max(OldRank,NewRank)/n,if NewRank>OldRank
OldRank-NewRank+max(OldRank,NewRank)/n,if NewRank<OldRank
If there are two Pogress Indexs in different tests have the same absolute value or there are two Pogress Indexs in the same test have the same value, GPS will be unhappy, he thinks it violated the differences between students. GPS wants to know if this situation can keep to the end of exactly n exams. Because this problem is too hard so GPS only ask you to give the answers when n<=100.
(Note: No two students can have the same rank in a test, the ranks will be 1..n)