Shoes Game

View as PDF

Points: 400 Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

\(N + 1\) (\(N\) is odd number) shoes from \((N + 1)/2\) pair of shoes the same type with different sizes are lined up in a
random order. The game master secretly take one of the shoes out and hide it. The player need to guess whether the
hidden shoe is for left foot or right foot and what is its size.
Write a program to solve this game with cheating computer power.

Input

  • The first line of input contains the one integer \(N (1 \le N \le 10^5)\), the number of shoes.

  • The following line contains \(N\) integers \(S_1, S_2, ..., S_N (1 \le |S_i| \le 10^9)\). Shoe \(i\) is for left foot if \(S_i < 0\), otherwise it is for right foot. The size of the shoe is \(|S_i|\).

Output

  • Output one integer \(R\) where \(|R|\) is equal to the hidden shoe’s size and it is negative if it is a shoe for left foot, positive
    otherwise.

Example

Test 1

Input
3
1 5 -1
Output
-5

Comments

There are no comments at the moment.