Beloved Teacher

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:
Hà Minh Ngọc
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Generally, based on EIU rule, if student absences at least ~20\%~ of lessons, they are banned from taking test. However, lecturer does not want to forbid more than ~10\%~ of class size from taking test. Therefore, the lecturer has to select an appropriate number of absent days which has to be the minimum number of absent days to ban students from taking test.

Your task is to find the minimum number of absent days so that maximum ~10\%~ of number of registered students (rounded to the nearest integer) are banned from taking test.

Input

  • The first line contains an integer ~N~ – attendance list size, and integer ~M~ – the number of lessons ~(1 \leq N \leq 10^5, M \leq 10^9)~.

  • Each number in the next ~N~ numbers represents an integer ~A_i~: number of absent days of ith student ~(1 \leq A_i \leq 10^9)~.

Output

  • The minimum number of absent days to meet the question's requirement.

Sample Input 1

5 23
5 3 0 9 7

Sample Output 1

8

Sample Input 2

16 23
2 6 4 1 1 3 8 7 3 5 3 2 0 1 0 0

Sample Output 2

7

Sample Input 3

20 23
2 2 4 1 1 3 2 7 3 4 3 2 0 1 0 0 2 1 3 0 

Sample Output

5

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.