QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 512 MB 満点: 50

#13390. Med

統計

这一时刻终于到来了。这不仅是本赛季 COCI 的最后一轮,也是 COCB(克罗地亚养蜂公开赛)的最后一轮。没有多少人知道,这两项比赛共享相同的计分系统。更具体地说,两项比赛都由六轮组成,每轮的分数在 $0$ 到 $500$ 之间,个人单轮得分相加得到最终总分。

在六轮比赛结束后,参赛者将根据六轮的总得分进行排名。如果两位参赛者的分数相同,则名字字典序较小的那位在排行榜上的排名更靠前。没有两位参赛者拥有相同的名字。

养蜂人们非常急切,他们想提前知道自己最终的排名。每位养蜂人都想知道自己在最终排行榜上可能获得的最好和最坏的排名。与熟练的 COCI 程序员不同,养蜂人们不知道如何编写代码。因此,他们请求你帮他们确定在第六轮结束后他们可能处于的排名范围。

输入格式

第一行包含一个正整数 $n$ ($1 \le n \le 500$),表示养蜂人的数量。

接下来的 $n$ 行,每行包含一个养蜂人的名字 $s_i$ ($1 \le |s_i| \le 10$) 和五个在 $[0, 500]$ 范围内的整数 $b_{i1}, b_{i2}, b_{i3}, b_{i4}, b_{i5}$,表示第 $i$ 个养蜂人在 COCB 前五轮中的得分。

养蜂人的名字互不相同,且最多由十个英文小写字母组成。

输出格式

输出 $n$ 行。在第 $i$ 行中,输出第 $i$ 个养蜂人在排行榜上可能获得的最好和最坏的排名。

子任务

子任务 分值 数据范围
1 10 $n = 2$
2 40 无附加限制。

样例

输入样例 1

3
pavel 120 200 300 400 500
keko 150 400 300 200 100
bartol 470 120 90 93 189

输出样例 1

1 2
1 3
2 3

输入样例 2

2
ante 275 275 275 275 275
mate 25 100 175 250 325

输出样例 2

1 1
2 2

说明

样例 2 说明

目前,Ante 的总分为 1375,Mate 的总分为 875。如果 Mate 在最后一轮获得 500 分,而 Ante 获得 0 分,结果将是平局,两人的总分都将是 1375 分。然而,由于 Ante 的名字字典序比 Mate 小,Ante 仍然会在排行榜中排在前面。

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.