In question 3, assume that there are 3 types of events: The general events are open for all, the course specific events are specific to some course types, the level specific events are specific to some levels of study only (ug, ph or phd). Check eligibility before carrying the registrations. Use inheritance.
Input Format: Same as above, except the event details are added with the following information:
For general events: “general” added to the event details
For course specific events: “course” followed by c (number of courses admissible), followed by c courses in the same line
For level specific events: “level” followed by l (number of levels admissible), followed by l levels in the same line
Output Format: Same as above
Sample Input:
Number of test cases |
1 |
Number of events |
5 |
Event 1 |
E1 Name1 Desc1 1 19:00 2 course 1 ece |
Event 2 |
E2 Name2 Desc2 3 18:00 1 general |
Event 3 |
E3 Name3 Desc3 3 17:00 2 level 2 phd pg |
Event 4 |
E4 Name4 Desc4 1 20:00 3 course 2 it ece |
Event 5 |
E5 Name5 Desc5 3 15:00 4 general |
Number of students |
5 |
Student 1 |
IIT1 S1 ug it |
Student 2 |
IIT2 S2 ug it |
Student 3 |
IIT3 S3 pg ece |
Student 4 |
IIT4 S4 phd ece |
Student 5 |
IIT5 S5 pg it |
Number of registrations |
10 |
Registration 1 |
IIT1 E1 |
Registration 2 |
IIT3 E1 |
Registration 3 |
IIT2 E3 |
Registration 4 |
IIT3 E5 |
Registration 5 |
IIT1 E4 |
Registration 6 |
IIT5 E1 |
Registration 7 |
IIT2 E5 |
Registration 8 |
IIT1 E3 |
Registration 9 |
IIT5 E3 |
Registration 10 |
IIT5 E5 |
Number of queries |
2 |
Queried student 1 |
IIT1 |
Queried student 2 |
IIT4 |
Sample Output:
Schedule |
Day 1 19:00(2) E1 Name1 Desc1 IIT3 S3 pg ece 20:00(3) E4 Name4 Desc4 IIT1 S1 ug it Day 3 15:00(4) E5 Name5 Desc5 IIT2 S2 ug it IIT3 S3 pg ece 17:00(2) E3 Name3 Desc3 IIT5 S5 pg it 18:00(1) E2 Name2 Desc2 |
Schedule for IIT1 |
IIT1 S1 ug it Day 1 20:00(3) E4 Name4 Desc4 |
Schedule for IIT4 |
IIT4 S4 phd ece |
Explanation
IIT1: E1 fails (it student trying ece only event), E4 registration succeeds, E3 fails (ug student trying pg-phd course)
IIT2: E3 fails (ug student trying pg-phd event), E5 registration succeeds
IIT3: E1 registration succeeds, E5 registration succeeds.
IIT5: E1 fails (it student trying ece only event), E3 registration succeeds, E5 fails (E3 starts at 17:00 and E5 starts at 15:00 and finishes at 19:00).
1 5 E1 Name1 Desc1 1 19:00 2 course 1 ece E2 Name2 Desc2 3 18:00 1 general E3 Name3 Desc3 3 17:00 2 level 2 phd pg E4 Name4 Desc4 1 20:00 3 course 2 it ece E5 Name5 Desc5 3 15:00 4 general 5 IIT1 S1 ug it IIT2 S2 ug it IIT3 S3 pg ece IIT4 S4 phd ece IIT5 S5 pg it 10 IIT1 E1 IIT3 E1 IIT2 E3 IIT3 E5 IIT1 E4 IIT5 E1 IIT2 E5 IIT1 E3 IIT5 E3 IIT5 E5 2 IIT1 IIT4