HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50860 - Number of Student Certificates

Guest
• Review clarifications (3)

Volume problems

• 50869 - Birthday Celebration
• 50821 - Derivative of an array
• 50513 - Climbing Up the Stairs
• 50854 - Area of Triangle Revised
• 50520 - Filling a Matrix Randomly
• 50497 - Falling Bricks - Revisited
• 50847 - The first m trains to leave
• 50669 - Area of an Irregular Polygon
• 50860 - Number of Student Cert...
• 50444 - n digit kth number divisible...
• 50865 - Apartment Building Adminis...
• 51011 - Decoding the Path
• 51019 - Finding the hidden message
• 51002 - The most successful classes
• 50525 - Ordering Pizza
• 50342 - 100 Factorial
• 50524 - Elevator

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Number of Student Certificates

Director of South East Tirana primary school is asking a special program from you. The school gives two types of special certificates: High Success and Excellence certificates. The lower limits of the certificates are decided every year according to student averages and they are given at the end of student grades. The students have grades from 7 lessons. However, some students are exempted from some lessons. If a student is exempted from more than 1 lesson, he cannot take Excellence certificate. And if a student is exempted from more than 2 lessons, he cannot take high success certificate.

Question: Write a program that reads student grades and counts the number of students taking certificates.

Input specification
You will be first given a number (n) the number students where 0 ≤ n ≤ 2000. Then, in the following n lines you will be given the grades of n students: at most 7 integers. If there are less than 7 grades, it ends with a negative number where each grade is an integer between 0 and 100. Then, you will be given two floating point numbers:

  • lower limit for Excellence certificate
  • lower limit for High Success certificate

Output specification:
Show two integers

  • The number of students who had Excellence certificate
  • The number of students who had High Success certificate

Sample Input I
10
67 91 91 61 100 75 -1
66 89 54 82 99 100 75
90 79 76 100 75 -1
68 100 82 96 -1
77 62 63 68 51 90 -1
66 52 81 74 92 62 92
89 80 67 81 72 91 77
98 75 94 74 74 96 70
88 56 71 98 55 51 -1
98 72 94 80 96 98 81
83 75
Sample Output I
2 4

Explanation: Student averages are:
  1. 80.83
  2. 80.71
  3. 84
  4. 86.5
  5. 68.5
  6. 74.14
  7. 79.57
  8. 83
  9. 69.83
  10. 88.43
Students 1,2, 3 and 7 receive High Success certificates. And students 8 and 10 receive Excellence certificates. Third student is exempted from 2 lessons and fourth student is exempted from 3 lessons. Although student 3 has higher average than Excellence certificate, he cannot take because he has 2 lessons exempted. But he can take High Success certificate. Student 4 is exempted from 3 lessons, so he cannot receive any certificate.



Для отправки решений необходимо выполнить вход.

www.contester.ru