提示: 欢迎访问OurACM平台。
Problem 1902 Graduate

Accept: 94    Submit: 175
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

One day , iyixaing is running on the playground ,and see the seniors take pictures .He is curious about how many different arrangement can the seniors stand with the limit that the senior back row is higher than the senior front row at each corresponding position and arrange the seniors from left to right , low to high for each row. To simple the problem, we give you the different height of N seniors , And you just need to consider the situation of two rows(of course no rows can be empty and the number of seniors back row should be no more than the front row ).

Input

First line is number of test cases T. For each test case ,first line is the integer N(2 <= N <= 100).and then N integers hi (1 <= hi <= 1000) followed .

Output

For each test case , first print “Case #x:” where x is case number. then output the answer mod 20100501.

Sample Input

2 2 1 2 3 1 2 3

Sample Output

Case #1: 1 Case #2: 2

Source

FOJ有奖月赛-2010年05月

Submit  Back  Status  Discuss