Professional Documents
Culture Documents
In the Indian Programming Camp (IPC), there were N students (numbered 1 to N) who watched K
lectures (numbered 1 to K). Each student i watched lecture j for Ti,j minutes. In addition, each
student i, asked the question "What are the criteria for getting a certificate?" Qi times.
Input
Output
Constraints
1 ≤ N, K ≤ 1, 000
1 ≤ M ≤ 106
1 ≤ Qi ≤ 106 for each valid i
Sample 1
Input Output
3 8 4 1
1 4 2 6 11
2 4 5 3 6
1 2 2 2 3
For 1st participant 1 + 4 + 2 + 6 = 13 but number of questions asked are 11 > 10. So, doesn't
get certificate.
For 2nt participant 2 + 4 + 5 + 3 = 14 and number of questions asked are 6 < 10. So, get
certificate.
For 3rd participant 1 + 2 + 2 + 2 = 7 which is < 8. So, doesn't get certificate.