luogu#P4413. [COCI2006-2007#2] R2

    ID: 8440 远端评测题 1000ms 125MiB 尝试: 1 已通过: 1 难度: 1 上传者: 标签>数论数学枚举暴力素数判断质数筛法COCI2006

[COCI2006-2007#2] R2

题目描述

The number S is called the mean of two numbers R1 and R2 if S is equal to (R1+R2)/2. Mirko's birthday present for Slavko was two integers R1 and R2. Slavko promptly calculated their mean which also happened to be an integer but then lost R2! Help Slavko restore R2.

输入格式

The first and only line of input contains two integers R1 and S, both between -1000 and 1000.

输出格式

Output R2 on a single line.

题目大意

S=R1+R22S= \dfrac{R_1+R_2}{2},给定 R1R_1SS (1000R1,S1000)(-1000 \le R_1,S \le 1000),求 R2R_2

11 15
19
4 3
2