문제
Problem 3: Counting Friends [Brian Dean, 2014]
Farmer John's N cows
Each cow has one or more friends with whom they interact on MooBook. Just for fun, Farmer John makes a list of the number of friends for each of his cows, but during the process of writing the list he becomes distracted, and he includes one extra number by mistake (so his list contains
입력
* Line 1: The integer N.
* Lines
출력
* Line 1:
An integer K giving the number of entries in FJ's list that could be the extra number (or, K=0 means that there is no number on the list whose removal yields a feasible pairing of friends).
* Lines
Each line contains the index
예제1
4
1
2
2
1
3
3
1
4
5
INPUT DETAILS:
Farmer John has 4 cows. Two cows have only 1 friend each, two cows have 2 friends each, and 1 cow has 3 friends (of course, one of these numbers is extra and does not belong on the list).
OUTPUT DETAILS:
Removal of the first number in FJ's list (the number 1) gives a remaining list of