409490: GYM103584 C Redwoods
Description
Redwoods are known as one of the tallest species of trees, reaching heights of more than 300 feet! Thus, Johnny has decided that he wants to build a treehouse in the redwood near his house. However, he also doesn't want to be lonely!
Johnny has decided that he will let those in if they were able to solve the answer to a question that he has devised. He will give anyone who wants to enter the list of numbers ranging from 1 to $$$n$$$ but has removed one number from the list. The numbers can also appear in any order, but each number will only appear once. Since he chose the number to remove at random, he wants to know the mean of the list of numbers as well. Output the floor of the absolute difference between the missing number that Johnny has removed and the mean of the list.
InputThe first line will consist of an integer that represents $$$n$$$ ($$$1 \leq n \leq 10^5$$$). The next line will contain $$$n-1$$$ integers where each integer $$$a_i$$$ ($$$1 \leq a_i \leq n$$$) represents a value in the list that Johnny will provide those who want to enter the treehouse.
OutputOutput the floor of the absolute difference between the missing number in the array and the mean of the list of numbers that Johnny has provided.
ExamplesInput5 1 2 4 5Output
0Input
2 1Output
1Note
In the first test case, the missing number is 3. The average of the numbers is also 3, so we output 0.
In the second case, we are missing a 2. Since the average of the numbers is 1, we output 1.