League of Legends

Xem dạng PDF

Gửi bài giải

Điểm: 1,00 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Nguồn bài:
Châu Nhật Tăng
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

In League of Legends, there are ~ n ~ champions, where the ~ i ~-th ~(0 < i \leq n)~ champion has physical damage and magical damage.

  • A champion ~ i ~ is considered stronger than champion ~ j ~ if ~ i ~ has higher physical damage ~(0 < i ≠ j \leq n)~.
  • If two champions have the same physical damage, the champion with higher magical damage is considered stronger.
  • If two champions have the same physical and magical damage, the champion with the smaller index is considered stronger.

Determine the physical and magical damage of the ~ m ~-th strongest champion.

Input

  • The first line contains the integers ~ n ~ and ~ m ~ (~ 1 \leq m \leq n \leq 10^5 ~).
  • The next ~ n ~ lines each contain two integers ~ A_i ~ (physical damage) and ~ B_i ~ (magical damage) (~ 0 \leq A_i, B_i \leq 10^5 ~).

Output

  • The physical and magical damage of the ~ m ~-th strongest champion.

Sample Input

3  2
1  2
3  2
1  3   

Sample Output

1  3

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.