PUCMM334  White Hats
There is a number of people in a room (between 2 and 100), and each of them wears a hat which is either black or white. Every person counts the number of other people wearing white hats. You are given the number counted by each person. Print the total number of people wearing white hats, or 1 if count doesn't correspond to a valid situation.
Input
The first line is N, the number of persons.
Then N space separaten integers follow, each one denoting the number of white hats each person sees.
Output
Print the total number of people wearing white hats, or 1 if count doesn't correspond to a valid situation.
Example
Input: Output:
3 2
2 1 1
Input: Output:
3 3
2 2 2
Input: Output:
2 0
0 0
Input: Output:
2 1
10 10
hide comments
iloveaakanksha:
20160625 05:42:58
Weaker test cases than CRLAVEN. 

mkfeuhrer:
20160621 22:53:12
CRNVALEN  same !! 

cute_girl_1:
20160129 16:23:00
forgot to delete scanf statement of crnvalen prob caused ce :( 

xpshekhar:
20160103 04:37:33
lots of boundary cases make this problem not that easy.


anuveshkothari:
20150714 08:31:25
same code as The Valentine Confession


Akshat Mathur:
20150626 11:49:45
Take care of this


:.Mohib.::
20150509 20:21:03
Easy.....AC... :)


ROHIT RAJ:
20150212 15:52:02
similar to CRNVALEN :) 

/* EDWARD KENWAY */:
20140226 21:12:16
there r some hidden/tricky cases for


parbays:
20140131 21:17:07
@Doshi, check for the boundary cases.

Added by:  Olson Ortiz 
Date:  20130101 
Time limit:  0.184s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM32GCC MAWK BC CCLANG CPP14CLANG CPP14 COBOL COFFEE DDMD DCLANG DART ELIXIR FANTOM FORTH GOSU GRV JSMONKEY KTLN NIM OBJC OBJCCLANG OCT PICO PROLOG PYPY R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET 
Resource:  Olimpiada de ProgramaciĆ³n PUCMM ACMISC 2013 