Prize Hunter
InterviewTime limit1sMemory limit512 MB
Given two ranks a and b from two contests, print the total prize money using each contest's published prize table.
- Level
Easy2 of 10
- Topics
- Implementation, Array
- Solved
- No attempts yet
Problem
After 2017, the Kakao Code Festival is held again in 2018.

Prizes are an inseparable part of the Kakao Code Festival. At the 1st Code Festival held in 2017, 21 of the 100 finalists received prizes according to the following rules.
At the 2nd Code Festival to be held in 2018, the prize pool is larger, and 31 of the 64 finalists will receive prizes according to the following rules.

JY wonders how much prize money he would receive by competing in the Code Festival. To find out the total prize money he could earn across the finals of the two Code Festivals, he used his imagination and made the following assumptions.
-
He advanced to the finals of the 1st Code Festival and placed ath (1 ≤ a ≤ 100). If he did not advance, then a = 0.
-
He will advance to the finals of the 2nd Code Festival and place bth (1 ≤ b ≤ 64). If he does not advance, then b = 0.
Under these assumptions, JY wants to know the total prize money he can receive.
Input
The first line gives the number of assumptions T (1 ≤ T ≤ 1,000) that JY made using his imagination.
The next T lines give the information for each assumption JY made, one per line. Each line contains two non-negative integers a (0 ≤ a ≤ 100) and b (0 ≤ b ≤ 64), separated by a single space.
Output
For each assumption, print the prize money JY receives as an integer in won, one per line. The output must follow the order of the input.