Server Time: Mon Oct 26, 2020 7:38 am
 Welcome ( logout )
A - Confusion in the Problemset
 PDF (English) Ranklist
 Time Limit: 2 second(s) Memory Limit: 32 MB

So with this rule, {3, 1, 2, 0} is valid but {3, 3, 1, 3} is not valid.

# Input

Input starts with an integer T (≤ 60), denoting the number of test cases.

Each case starts with a line an integer n (1 ≤ n ≤ 10000) denoting the number of pages in the problem-set. The next line contains n space separated integers denoting the page number written on the pages. The integers lie in the range [0, 106].

# Output

For each case, print the case number and "yes" if the pages can be shuffled somehow to meet the given restrictions. Otherwise print "no".

2

4

0 3 1 2

4

1 3 3 3

Case 1: yes

Case 2: no

# Notes

1.      For case 1, the pages can be shuffled in several ways so that the page numbering is valid. One of the valid shuffles is 3, 1, 2, 0.

2.      For case 2, there is no valid way to shuffle these.

Problem Setter: Md. Mahbubul Hasan
Special Thanks: Md. Towhidul Islam Talukder, Jane Alam Jan
 Developed and Maintained by JANE ALAM JAN Copyright © 2012 LightOJ, Jane Alam Jan