Problem list
Log in
#coci00007 · COCI 2006/2007 Contest 2

R2

Bronze IV 1.0 s 32 MB

The number $C$ is called the mean of two numbers $R_1$ and $R_2$ if $S$ is equal to $\frac{R_1+R_2}{2}$. Mirko's birthday present for Slavko was two integers $R_1$ and $R_2$. Slavko promptly calculated their mean, which also happened to be an integer, but then lost $R_2$! Help Slavko restore $R_2$.

Input

The first and only line of input contains two integers $R_1$ and $S$, both between $1$ and $1000$ — $R_1$ is the number Slavko still has, and $S$ is the mean he computed.

Output

Output $R_2$ on a single line.

Example 1

Input
11 15
Output
19

Example 2

Input
4 3
Output
2
Source
COCI 2006/2007 Contest 2
Appears in
Not part of a ladder, contest or set yet.
Accepted 1 Submissions 1 Acceptance 100% Solvers 1

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