PAML  Popeye and the magical land
As usual Popeye and brutus are fighting for olive, and suddenly a witch appears and took popeye to magical land as brutus called that witch. In magical land, the witch with her magic make N(1<=N<=100) number of clones of popeye of different strength(0<=Si<=100) i.e each popeye can hold another popeyes above his head, and number of popeyes which can be hold will be less than or equal to strength of popeye which is holding other popeyes.
Eg: Imagine there are three popeyes: the first has strength 2, the second has strength 1 and the third has strength 1. We cannot put the second and the third popeye simultaneously on the top of the first one. But the second popeye can place directly on the top of the first one, and then the third popeye directly on the top of the second one.We will call such construction of popeye a "Popeyestack".
The witch want him to make Minimum number of popeyestack and give her Maximum Height of popeyestack from that arrangement, then only she release him from the magic and give him spinach to defeat brutus. Help popeye to get released from the magic of the witch.
Input
First line of Input contains no. of test cases T(T<=1000). Each test case contain two lines: 1st line contains N (1<=N<=100) and 2nd line contain N spaced Si (strength of N popoyes) (0<=Si<=100)
Output
For each test case output a string "Case #i: " ("i" is test case number) followed by Minimum number of popeyestack and Maximum Height of popeyestack seperated by a space.
Example
Input: 2
5
0 1 2 3 4
9
0 1 0 2 0 1 1 2 10 Output: Case #1: 1 5
Case #2: 3 4
hide comments
Julian Waldby:
20141025 19:05:05
Is one Popeye by himself a Popeye stack of height 1? 

heatOn:
20140627 15:33:45
Please check my submission I do not know why I am getting WA I have tried generating many test cases and it is working fine on those. And Please specify does the problem statement ask us to find two seperate arrangements such that in the first minimum number of stacks are used and in the second arrangement maximum height of a stack is obtained ?


Maru:
20140627 15:33:45
What do you mean by :"Minimum number of popoyestack"? Last edit: 20140512 17:49:14 

BLANKRK:
20140627 15:33:45
nice one!!! 
Added by:  P_Quantum 
Date:  20140417 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 