Problem list
Log in
#r02769 · Online Judge > GoldOJ

Find the Missing Number

Bronze III 2.0 s 1024 MB

The sum $s$ of the original $n$ integers is given, along with $n-1$ of them. Print the missing integer.

Input

First line $n$ and $s$; then $n-1$ integers, each in $[0, 1000]$, one per line ($2 \le n \le 1000$).

Output

Print the missing integer, $s$ minus the sum of the given numbers.

Example 1

Input
5 30
3
7
8
10
Output
2
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code