Mystic Falls School
Submissions: 1072   Accuracy:


  Difficulty: Easy   Marks: 2

Mystic Falls School (which has classes from 1 to 12) allots admission numbers to Students as negative and  positive integers. Damon is a new admission in this school and he is the 199th student to get admission in class 11th. To his surprise, he has been allotted admission number as  -189. Damon being a curious guy wants to know the logic behind the admission number allotment. Can you help him!

The first line of the input contains an integer T denoting the number of test cases. The description of each testcase follows. Each test case contains a single line with 2 integers which are Xth student and  Gth grade i.e. class.

For each test case, output a new line with a single integer which should be the the admission number of the Xth student.

1 < =  G  < = 12             
1 < =  X  <  = 10000
1 < = T  < = 900

 Input : 

129  5
150  7
 556  8
 9  2
348  10
223  12
Output :

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Diksha Singhal
Author: diksha1812

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.