Throwing Cards Away II

Problem Number: 
10 940
Type of Problem: 
Problem Category: 
Input: 
Random Input
Critical Input
0
Critical Input: 
1 22 3333 444444 500000 66666 777 89 9999 0
Random Input: 
2749 219410 501 146486 8 21032 4618 26 9923 816 277 51752 88 287 128005 75 6014 3471 14324 395560 5 309045 217 293 500000 3641 580 575 44157 45678 39 263257 28 39 409742 505 83716 1 76878 343639 36728 154 411742 88867 8692 346 2041 94705 403 643 0
Problem Id: 
10940