Given a sequence containing N integers where each integer is between 1 and 1000(exclusive), prove that at least one duplicate number must exist. Assume that there could be multiple duplicate numbers, find the maximum value of duplicate one.
Note : If you are using visual studio, add #pragma warning(disable:4996) in the first line so that you can use scanf on your local machine.
N
S
N is an integer, and 1<=N<10000.
S is a sequence. Each integer in it is between 1 and 1000(exclusive).
Maximum duplicate number.
Remember change line in the end.