Enemy losses
Limits: 1 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Every morning, every Ukrainian opens the General Staff report to see the losses suffered by the enemy over the past day. Zenyk does this as well, and in addition, he writes down the data on enemy losses in a notebook.
Zenyk recorded losses every day for \(n\) days, but suddenly noticed that he made
a mistake and lost the data regarding enemy losses for one of the days.
However, Zenyk knows the total number of losses \(y\), as well as the fact that the enemy
lost a positive number of soldiers every day. Thus, he can restore the
number of enemy losses on that day, provided that Zenyk did not make
another mistake in his notes. Help Zenyk restore the number of enemy
losses for the day for which data is missing. If Zenyk made an
additional mistake in the notebook, print
Another mistake!
Input
The first line contains two integers \(n\) and \(x\) — the number of days for which Zenyk recorded statistics, and the total enemy losses.
The next line contains \(n - 1\) numbers \(a_i\), separated by spaces — the data on daily enemy losses according to Zenyk’s notebook.
Output
Print a single number — the number of enemy losses on the day when Zenyk forgot to record the data.
If Zenyk made another mistake in his notebook and the data in the
notebook is contradictory, then print Another mistake!.
Constraints
\(1 \le n \le 10^5\),
\(1 \le x \le 10^{9}\),
\(1 \le a_i \le 10^9\),
\(1 \le \sum_{i=1}^n a_i \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 1 146092572 | 146092572 |
| Input (stdin) | Output (stdout) |
|---|---|
| 3 47 4 7 | 36 |
| Input (stdin) | Output (stdout) |
|---|---|
| 2 7 47 | Another mistake! |
Notes
In the first test, the enemy lost all soldiers on the very first day, so Zenyk didn’t even have time to write anything in his notebook.
In the third test, according to the notebook, the enemy lost more soldiers in a single day than the total amount. From this, we can conclude that there is a mistake in the notebook.
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|