Universal Cup Judging System

Universal Cup

Limite de temps : 3.0 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓
Statistiques

Hitagi Senjougahara 有一張高度係 $h$、闊度係 $w$ 嘅紙。呢張紙分做一個個 $1 \times 1$ 嘅格仔。假設張紙左下角嘅座標係 $(0, 0)$,右上角嘅座標係 $(h, w)$。

Hitagi 可以剪好多次,每次可以係打直或者打橫剪。對於打橫剪,Hitagi 會揀一個整數高度 $h' \in [1, h - 1]$,然後剪開所有穿過呢條線嘅紙片。對於打直剪,Hitagi 會揀一個整數闊度 $w' \in [1, w - 1]$,然後剪開所有穿過呢條線嘅紙片。所以如果佢喺唔同高度打橫剪咗 $c_h$ 次,又喺唔同闊度打直剪咗 $c_w$ 次,佢最後就會得到 $(c_h + 1)(c_w + 1)$ 張紙片。

依家 Hitagi 想知道,如果要令最後得到嘅所有長方形紙片嘅面積都唔超過 $s$,最少需要剪幾多次。

你嘅任務係搵出 $t$ 組三元組 $h, w, s$ 嘅答案。

輸入格式

第一行包含整數 $t$($1 \le t \le 1\,000$)—— 你需要解決嘅測試組數。

接住落嚟嘅 $t$ 行包含整數三元組 $h, w, s$($1 \le h, w, s \le 10^9$)—— 張紙嘅大細同埋目標面積上限。

輸出格式

輸出 $t$ 行,每行包含 1 個整數 —— 對應三元組嘅答案。

範例

輸入 1

5
2 2 1
1 7 2
4 4 17
4 4 15
120 216 34

輸出 1

2
3
0
1
55

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#366EditorialOpen题解jianglyView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.