国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

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的評論 (共 條)

分享到微博請遵守國家法律
盐池县| 永寿县| 闽清县| 新源县| 冀州市| 武川县| 垣曲县| 红桥区| 志丹县| 芷江| 扎囊县| 聂拉木县| 昌吉市| 金昌市| 林西县| 承德市| 郴州市| 泸州市| 江川县| 余庆县| 嘉定区| 红桥区| 甘肃省| 常宁市| 松潘县| 新兴县| 汽车| 安塞县| 运城市| 准格尔旗| 璧山县| 湖南省| 南乐县| 普兰店市| 宝坻区| 民乐县| 龙岩市| 东城区| 屏山县| 梁河县| 将乐县|