#10. 罐头的奖学金
罐头的奖学金
The annual scholarship selection at the college has begun! The awarding of scholarships is not solely based on final exam rankings, but rather on the rankings from a comprehensive quality assessment. The number of scholarships available is determined by the number of students in the major and a fixed percentage. Through her connections in the college, Kanto learned that the number of students who can receive scholarships is ( m ), and besides her, there are ( n ) other students interested in applying for the scholarship. Only the top ( m ) students in the comprehensive quality rankings will receive the scholarship.
According to college regulations, the comprehensive quality assessment includes three aspects: basic quality, knowledge and learning ability, and innovation and practical ability, with respective weights of 10%, 70%, and 20%. Each aspect has a maximum score of ( q ), and all scores are positive integers.
Kanto has confirmed that she will receive full marks in the basic quality aspect, but due to not having held any positions or received any awards, her score in innovation and practical ability is 0. Now, Kanto has gathered the scores of the other ( n ) students in all three aspects, but she is troubled because she does not know how many points she needs to score in knowledge and learning ability to guarantee receiving the scholarship.
Please help Kanto solve this problem. If it is impossible for her to receive the scholarship under any circumstances, please output "Keep On Fighting" abbreviated as KOF.
Input Format
- The first line contains three integers ( m, n, q ), representing the number of scholarship recipients, the number of applicants excluding Kanto, and the maximum score for each aspect.
- The next ( n ) lines each contain three integers ( a, b, c ), representing the scores of other students in the aspects of basic quality, knowledge and learning ability, and innovation and practical ability.
(Conditions: ( 0 < a, b, c \leq q \leq 10000 ), and ( 0 \leq m, n \leq 1000 ))
Output Format
- Output an integer representing the minimum score Kanto needs to achieve in knowledge and learning ability.
Sample Input
3 6 750
729 473 642
601 280 505
605 670 282
594 692 616
727 350 574
698 686 405
Sample Output
730