"So, people of Stormwind! Let us unite this day. Let us renew our promise to uphold and protect the Light, and together we will face down this dark new storm and stand firm against it—as humanity always has… and humanity always will!"
The crowd saved its greatest roars for the end. A chorus of "Long live King Varian! Long live King Varian!" rose into the sky with vigor and conviction. The cheers were unending, echoing deep into Elwynn Forest and faintly reaching even the distant peaks of the Redridge Mountains.
Varian Wrynn gained a rectangular piece of gold in the battle, with length nn and width mm. Now he wants to draw some lines on the gold, so that later he can cut the gold along the lines.
The lines he draws should satisfy the following requirements:
Varian Wrynn wants to cut the gold in such a way that maximizes the lines he draws.
As Alliance's Supreme King, he certainly doesn't have time to do this. So he finds you! Please help him to cut the gold!
The input consists of multiple test cases.
The first line contains an integer T (1≤T≤100) indicating the number of test cases.
Each test case consists of one line containing three integers n,m,k (1≤n,m,k≤105). Its guaranteed that n×m≥k.
2
5 4 2
10 9 13
5
4