P9360 [ICPC 2022 Xi'an R] Clone Ranran

Description

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 Format

N/A

Output Format

N/A

Explanation/Hint

**Source**: The 2022 ICPC Asia Xi'an Regional Contest Problem C. **Author**: MagicSpark.