最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網 會員登陸 & 注冊

CF 1850A - To My Critics

2023-07-25 14:39 作者:您是打尖兒還是住店呢  | 我要投稿

In the game show "Ten Words of Wisdom", there are n participants numbered from 1 to n, each of whom submits one response. The i-th response is ai words long and has quality bi. No two responses have the same quality, and at least one response has length at most 10.

The winner of the show is the response which has the highest quality out of all responses that are not longer than 10 words. Which response is the winner?

Input

The first line contains a single integer t (1≤t≤100) — the number of test cases.

The first line of each test case contains a single integer n (1≤n≤50) — the number of responses.

Then n

?lines follow, the i-th of which contains two integers ai and bi (1≤ai,bi≤50) — the number of words and the quality of the i-th response, respectively.


Additional constraints on the input: in each test case, at least one value of i satisfies ai≤10, and all values of bi are distinct.

Output

For each test case, output a single line containing one integer x (1≤x≤n) — the winner of the show, according to the rules given in the statement.


It can be shown that, according to the constraints in the statement, exactly one winner exists for each test case.

---------------------------------------------------

游戲節(jié)目“智慧十句話”中,有n位參與者,編號為1到n,每人提交一個答案。 第 i 個響應的長度為 ai,質量為 bi。 沒有兩個響應具有相同的質量,并且至少一個響應的長度最多為 10。

該節(jié)目的獲勝者是所有不超過 10 個字的回復中質量最高的回復。 哪一個反應是獲勝者?

輸入

第一行包含一個整數(shù) t (1≤t≤100) — 測試用例的數(shù)量。

每個測試用例的第一行包含一個整數(shù) n (1≤n≤50) — 響應數(shù)。

然后n

? 接下來的行,其中第 i 行包含兩個整數(shù) ai 和 bi (1≤ai,bi≤50) — 分別是單詞數(shù)和第 i 個響應的質量。


對輸入的附加約束:在每個測試用例中,至少有一個 i 值滿足 ai≤10,并且 bi 的所有值都是不同的。

輸出

對于每個測試用例,根據語句中給出的規(guī)則,輸出一行,其中包含一個整數(shù) x (1≤x≤n) — 節(jié)目的獲勝者。


可以證明,根據語句中的約束,每個測試用例恰好存在一個獲勝者。

-------------------------------------

下面是代碼:


CF 1850A - To My Critics的評論 (共 條)

分享到微博請遵守國家法律
平昌县| 丰顺县| 于田县| 遵义市| 肇东市| 乌拉特中旗| 临潭县| 石嘴山市| 纳雍县| 阳江市| 伊川县| 德昌县| 固始县| 南皮县| 孟连| 鞍山市| 青阳县| 铜鼓县| 贡山| 达尔| 肥乡县| 侯马市| 平果县| 临潭县| 通海县| 陕西省| 广灵县| 沁源县| 天峻县| 黔南| 巢湖市| 英吉沙县| 神池县| 门源| 涿州市| 武汉市| 三河市| 金溪县| 双江| 扎赉特旗| 罗平县|