C. Clone Ranran
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

Ranran needs to prepare a contest! A contest is made of $$$c$$$ problems, and Ranran can do one of the following two things:

  • Clone himself in $$$a$$$ minutes. That is, after $$$a$$$ minutes, there will be one more Ranran.
  • Prepare a problem in $$$b$$$ minutes. That is, after $$$b$$$ minutes, there will be one more problem.

Note that a cloned Ranran can also do the two things above. A Ranran cannot do the two things at the same time.

Ranran wants to prepare the contest as fast as possible. But he is very lazy, so he asks you to find the minimum number of minutes to prepare the contest.

You need to answer $$$T$$$ queries independently.

Input

The first line contains an integer $$$T$$$ ($$$1\leq T\leq 10 ^ 5$$$).

Each of the next $$$T$$$ lines contains three integers $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1\leq a, b, c\leq 10 ^ 9)$$$, representing a query.

Output

For each test case, output a line with a single integer representing the answer.

Example
Input
5
1 1 1
2 3 3
9 9 9
3 26 47
1064 822 1048576
Output
1
7
45
44
21860