Mother Hubbard
Output: Standard Output (stdout)
Memory limit: 256 megabytes
Time limit: 1.0 seconds
Mother Hubbard could count her children... sort of.
She has a people mover for a vehicle and at 3.10pm heads out the door to pick up 10 of her kids from school. And then she runs all over town for about 3 hours dropping them off and picking them up from after school activities (judo, jazz ballet, swimming classes, extra Maths tuition, music lessons...). Not all children will necessarily participate in activities every day.
She starts the day collecting all 10 children from school. Can you tell her if she's managed to bring 10 home at the end of the day?
Input
The first line contains a single integer, N (0 \le N \le 1000).
Then follows N lines, each containing a single non-zero integer.
- A negative integer indicates how many children have left her car to go to some activity.
- A positive integer indicates the number of children who got back in the car.
It is guaranteed that the input will correspond to a valid sequence of events – the number of children in the car will always be between 0 and 10 at any given time.
Output
If Mother Hubbard has collected all 10 children at the end of the day, print She's got them all
on a single line.
Otherwise, print a single integer – the number of children she's forgotten to collect.
Sample Explanation
Sample Case 1: 10-1-3+2-1+1-4+6=10 – she's got back to 10.
Sample Case 2: 10-3-1-1+1-4+6=8 – there's 2 missing.
-
Sample Input 1
7 -1 -3 2 -1 1 -4 6
Sample Output 1
She's got them all
-
Sample Input 2
6 -3 -1 -1 1 -4 6
Sample Output 2
2