8645: Stormwind

内存限制:128 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

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

  1. The endpoints of the lines should be on the boundary of the gold.
  2. The lines should be parallel to at least one boundary of the gold.
  3. After cutting along all the lines, each piece of gold is a rectangle with integer length and width.
  4. After cutting along all the lines, the area of each piece of gold should be at least k.
  5. Two lines should not share more than one common points.

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 (1T100) indicating the number of test cases.

Each test case consists of one line containing three integers n,m,k (1n,m,k105). Its guaranteed that n×mk.

输出格式

For each test case, output one line containing one integer, the maximum number of lines you can draw.

输入样例 复制

2
5 4 2
10 9 13

输出样例 复制

5
4

数据范围与提示

In the first test case, Varian Wrynn can draw 4 lines parallel to the boundary of length 4 and 1 line parrallel to the boundary of length 5. After cutting along the lines, he can get 10 pieces of gold of size 2.