Find R2
Time limit1sMemory limit128 MB
Given R1 and the average S of two integers, compute and print the other integer R2.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The average S of two integers R1 and R2 is (R1 + R2) / 2.
Given R1 and the average S, find the second number R2.
Input
The first line contains two integers R1 and S, separated by a space.
Each number is between -1000 and 1000, inclusive.
Output
Print R2 on the first line.