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: deactjustCalvin

Vishal Arora 1 | 580 |

KohliAbhijeet | 210 |

TYSSSantosh | 196 |

VikaSh 2 | 192 |

rohanrko | 192 |

Aditya Singh 17 | 952 |

stupid_af | 841 |

Dhaya_Mohan | 645 |

Whatever_As_If | 613 |

TYSSSantosh | 611 |

akhayrutdinov | 4717 |

Quandray | 3746 |

sanjay05 | 3668 |

Ibrahim Nash | 3664 |

surbhi_7 | 2776 |