408162: GYM103034 E Simple Exercise

Memory Limit:1024 MB Time Limit:15 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Simple Exercisetime limit per test15 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output

This problem was created a long time ago. However, since I don't think it was seriously attempted, here it is again.

duckmoon is solving trivial problems on new online judges again. duckmoon99 is browsing the source codes that were submitted by duckmoon. One of the codes caught his attention. Here's the problem statement :

  • Given n positive integers a1, a2, ..., an, find the value of modulo 109 + 7.

    There are t testcases in each input file.

    The first line of input contains the integer t.

    Each testcase consists of two lines. The first line contains the integer n. The second line contains n integers, denoting a1, a2, ..., an.

    Output the correct answer for each testcase on a new line.

Here's his submission to the problem : https://ideone.com/uRM2Po

duckmoon99 immediately contacted duckmoon and told him that his code is wrong. duckmoon said : "But the constraints for n is small enough for the O(tn2) solution to pass. How else could my code possibly be wrong?"

duckmoon99 shakes his head and constructed some testcases for which duckmoon's code will get the wrong answer. Can you find such testcases?

Input

The first line of input contains three integers T, N, MAX (T = 2000, N = 100, MAX = 1000).

This means that in your testcase 1 ≤ t ≤ T, 2 ≤ n ≤ N, 1 ≤ ai ≤ MAX for all 1 ≤ i ≤ n. If any of your testcases are invalid, you get 0 points.

Additionally, all the t testcases must be distinct. Two testcases are distinct if either their values of n are distinct, or there exist an integer that has a different number of occurences in the two sequences of n integers. For example, (2, 3, 2) and (3, 2, 2) are not distinct but (2, 3, 2) and (3, 3, 2) are distinct. If not all t testcases are distinct, you get 0 points.

Output

The first line of output should contain a single integer t (1 ≤ t ≤ T), denoting the number of testcases.

Each testcase consists of two lines. The first line contains the integer n (1 ≤ n ≤ N). The second line contains n space-separated integers, denoting a1, a2, ..., an (1 ≤ ai ≤ MAX).

All t testcases must make duckmoon's code produce a wrong output.

Here's an example of an output if T = 2, N = 1500, MAX = 1000 (that will not be accepted because the code prints the correct answer)


2
5
2 4 1 1000 3
4
5 3 81 191

Note that the output of the program is


10035
17662

which is correct.

Scoring

If any of the t testcases make duckmoon's code produce a correct output, you get 0 points.

Assume that the total score is 100 points.

Let N0 be the minimum positive integer such that there exist a testcase that fails duckmoon's solution with n = N0.

There are two modes of scoring depending on your testcases :

Mode 1 : When all t testcases satisfy n = N0.

Then, your score for this problem is .

Mode 2 : Not all t testcases satisfy n = N0.

Suppose X of the t testcases satisfy n ≤ 50. Your score for this problem is min(30, 10 + X).

加入题单

算法标签: