All submissions for this problem are available.
Recently a new casino has started in the city. So our chef tried his luck there. He tried many games there but didn't succeed in any of them. After trying his luck in a number of games ,finally he found a new but interesting game.
In that game, two numbers will be displayed on two separate screens, after watching these numbers, a player has to predict his lucky number and then a number will appear on the casino table which decides whether he will win the game or not. Our chef wasn't good in maths so he lost few games but later on he figured out that the lucky number displayed on the casino table follows a certain pattern.
So write a code for the chef which would help him in winning the game.
First line will be no of input sets n
Next n lines has two numbers that are the numbers displayed on the screen.
It shows only the final number chef has to predict to win the game.
- 1 ≤ n ≤ 10^4
- 1 ≤ Number 1 ≤ 10^4
- 1 ≤ Number 2 ≤ 10^4
Input: 3 7 8 6 2 3 5 Output: 15 4 6
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, GO|
Fetching successful submissions
If you are still having problems, see a sample solution here.