#abc228c. C - Final Day

C - Final Day

Score : 300300 points

问题陈述

NN 名学生正在进行一场为期 44 天的考试。

每天有 300300 分的测试题,总计 12001200 分。

前三天的考试已经结束,现在即将开始第四天的考试。第 ii 名学生(1iN1 \leq i \leq N)在第 jj 天(1j31 \leq j \leq 3)获得了 Pi,jP_{i, j} 分。

对于每位学生,确定在第四天结束后他/她是否有可能排名前 KK 位。 这里,第四天结束后学生的排名定义为:总分高于该学生的同学数加 11

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

NN students are taking a 44-day exam.

There is a 300300-point test on each day, for a total of 12001200 points.

The first three days of the exam are already over, and the fourth day is now about to begin. The ii-th student (1iN)(1 \leq i \leq N) got Pi,jP_{i, j} points on the jj-th day (1j3)(1 \leq j \leq 3).

For each student, determine whether it is possible that he/she is ranked in the top KK after the fourth day.
Here, the rank of a student after the fourth day is defined as the number of students whose total scores over the four days are higher than that of the student, plus 11.

Constraints

  • 1KN1051 \leq K \leq N \leq 10^5
  • $0 \leq P_{i, j} \leq 300 \, (1 \leq i \leq N, 1 \leq j \leq 3)$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK

P1,1P_{1,1} P1,2P_{1,2} P1,3P_{1,3}

\vdots

PN,1P_{N,1} PN,2P_{N,2} PN,3P_{N,3}

Output

Print NN lines. The ii-th line (1iN)(1 \leq i \leq N) should contain Yes if it is possible that the ii-th student is ranked in the top KK after the fourth day, and No otherwise.

Sample Input 1

3 1
178 205 132
112 220 96
36 64 20

Sample Output 1

Yes
Yes
No

If every student scores 100100 on the fourth day, the 11-st student will rank 11-st.
If the 22-nd student scores 100100 and the other students score 00 on the fourth day, the 22-nd student will rank 11-st.
The 33-rd student will never rank 11-st.

Sample Input 2

2 1
300 300 300
200 200 200

Sample Output 2

Yes
Yes

Sample Input 3

4 2
127 235 78
192 134 298
28 56 42
96 120 250

Sample Output 3

Yes
Yes
No
Yes

update @ 2024/3/10 09:58:29

}