**Compilation/Execution Result:**

Davis who has number of scanners in his shop select only two scanners to scan the documents of a customer. When a customer comes to his shop he knows three parameters S1, S2 and N. S1 and S2 are the time taken by scanner 1 and scanner 2 to scan one document respectively And N is the number of documents given by the customer. As he is suppose to entertain a number of customers, he wants to calculate the minimum time to scan all the N documents using those two scanners.

**Input:**

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains three space separated integers S1, S2 and N.

**Output:**

In new line, print the minimum time required.

**Constraints:**

1<=T<=500

1<=S1,S2,N<=10^{6}

**Example:
Input:**

2

2 4 2

1 2 2

4

2

Author: justCalvin

SANJAY5797 | 143 |

Himanshusinghchauhan | 108 |

iharshitmittal | 106 |

Lam Ngoc Pham | 101 |

dauntless | 100 |

Shashank_Pathak | 646 |

dark_knights | 560 |

surbhi_7 | 556 |

SANJAY5797 | 451 |

Vasudha Gupta | 377 |

akhayrutdinov | 4161 |

sanjay05 | 3633 |

Quandray | 2833 |

Ibrahim Nash | 2524 |

Michael Riegger | 2304 |