QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100 可 Hack ✓

#14246. 曲线评分

统计

“别担心,大家在他的考试里考得都很差。”

Peggert 教授以其平均分和中位数极低且没有加分机会的考试而闻名。尽管如此,他的学生们的最终成绩(通常)看起来还不错,因为他会通过按比例调整分数(grading on a curve)来提高每个人的分数。Peggert 教授通过选择一个正整数 $K$,并将每个学生的分数除以 $K$ 得到一个百分比来作为该学生的最终成绩。例如,如果一个学生在满分为 12 分的考试中得了 5 分,且选择 $K$ 为 10,那么该学生将获得 $5/K = 50\%$ 的成绩。他希望选择一个数字 $K$ 满足以下条件:

  1. 至少有四分之一的学生最终成绩达到 $90\%$(A-)或以上;
  2. 至少有一半的学生最终成绩达到 $80\%$(B-)或以上;
  3. 至少有四分之三的学生最终成绩达到 $70\%$(C-)或以上。

Peggert 教授不想把分数调得过于慷慨,因此他希望在满足上述条件的前提下,使 $K$ 尽可能大。请注意,选择的 $K$ 可以是任何正整数,即使选择的 $K$ 会导致某些最终成绩超过 $100\%$。

输入格式

第一行包含两个空格分隔的整数 $1 \le N, T \le 100\,000$,其中 $N$ 是学生人数,$T$ 是考试中学生可能获得的最高分数。

接下来的 $N$ 行,每行包含一个整数 $T_i$($0 \le T_i \le T$),表示单个学生的考试成绩。

输出格式

输出一行,包含满足条件的最大的数字 $K$。如果不存在这样的数字,则输出 $-1$。

样例

输入格式 1

4 10
5
6
7
8

输出格式 1

8

输入格式 2

4 100
76
53
83
67

输出格式 2

92

输入格式 3

4 10
10
0
10
0

输出格式 3

-1

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.