QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 1024 MB مجموع النقاط: 100 قابلة للهجوم ✓

#18315. 版本号

الإحصائيات

在大语言模型的早期阶段,研究人员发现了一个有趣的现象:当被问及“5.11 和 5.9 哪个更大”时,许多模型会自信地回答 5.11。据推测,这些模型混淆了小数的比较规则与版本号的比较规则——在版本号比较中,5.11 确实大于 5.9,因为次版本号 11 大于 9。

每个版本号由两个非负整数组成:主版本号 $x$ 和次版本号 $y$,记作 $x.y$。

版本号的比较规则如下:首先比较主版本号,主版本号较大的版本号更大。如果主版本号相同,则比较次版本号,次版本号较大的版本号更大。形式化地,版本号 $x_1.y_1$ 大于版本号 $x_2.y_2$ 当且仅当 $x_1 > x_2$,或者 $x_1 = x_2$ 且 $y_1 > y_2$。

给定 $n$ 个版本号,你需要找到其中最大的一个。

输入格式

输入包含多组测试数据。输入的第一行包含一个整数 $T$ ($1 \le T \le 100$),表示测试数据的组数。对于每组测试数据:

第一行包含一个整数 $n$ ($2 \le n \le 100$),表示版本号的数量。

接下来的 $n$ 行中,第 $i$ 行包含两个整数 $x_i$ 和 $y_i$ ($0 \le x_i, y_i \le 10^3$),表示版本号 $x_i.y_i$。

输出格式

对于每组测试数据,输出一行,包含两个由空格隔开的整数 $x'$ 和 $y'$,分别表示最大的版本号的主版本号和次版本号。

样例

输入样例 1

3
3
5 11
5 9
3 12
2
1 0
0 1
2
0 0
0 0

输出样例 1

5 11
1 0
0 0

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.