Pyrotechnician - 2
After graduation, Vitaliy, whom we mentioned earlier, gained significant popularity and began receiving invitations to organize fireworks displays nationwide. It's fair to say that Vitaliy's skills haven't improved; he still uses the same two substances, a and b, though the quantities have increased considerably. Your task is to continue assisting him by providing the explosion's power for each of his requests.
To ensure the fireworks are both beautiful and powerful, the explosion's power must be maximized. The power of the explosion is calculated using the formula:
a, a+1, ..., b-1, b,
where a and b represent the quantities of the first and second substances, respectively.
Input
The first line contains a single integer 1 ≤ t ≤ 900000, representing the number of requests. The following t lines contain the requests themselves: numbers a_i and b_i, which are the quantities of the two substances (0 ≤ a_i ≤ b_i ≤ 10^17).
Output
For each request, output the explosion's power on a separate line.