Question 2

0

0 votes
Easy
Problem

A student registers for numerous such events. The registration information for every student is provided by providing the roll number and event ID. Given a number of such registrations, first print the event schedule as in question 1, however printing all participating students in a new line. Then a number of queries are raised with every student specifying the roll number of a student. Print the schedule of the queried students.

Input Format: The first line is the number of test cases. For each test case, the first line is n, the number of events, followed by details of all events as in Q1. Thereafter, the next input is s, the number of students, followed by s line, 1 for each student. For each student the input is roll number (string), name (1 word string), level of study (ug, pg or phd, in small letters) and course (it, ece in small letters). Note that there may be more than 2 courses. Thereafter the next input is r, the number of registrations. The next r lines denote the student roll number and event ID. The next input is q, the number of student queries. The next q lines have a roll number each, whose time table is to be printed.

Output Format: As above, except that the list of registered students details is printed in a sorted order by roll number in addition with every event. Also, the schedule for queried events is printed in addition. For each student print the student details followed by the event schedule.  

Sample Input

Number of test cases

1

Number of events

5

Event 1

E1 Name1 Desc1 1 19:00 2

Event 2

E2 Name2 Desc2 3 18:00 1

Event 3

E3 Name3 Desc3 3 17:00 2

Event 4

E4 Name4 Desc4 1 20:00 3

Event 5

E5 Name5 Desc5 3 15:00 4

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

IIT1 S1 ug it

IIT3 S3 pg ece

IIT5 S5 pg it

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

IIT5 S5 pg it

17:00(2) E3 Name3 Desc3

IIT1 S1 ug it

IIT2 S2 ug it

IIT5 S5 pg it

18:00(1) E2 Name2 Desc2

Schedule for IIT1

IIT1 S1 ug it

Day 1

19:00(2) E1 Name1 Desc1

20:00(3) E4 Name4 Desc4

Day 3

17:00(2) E3 Name3 Desc3 

Schedule for IIT4

IIT4 S4 phd ece

 

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?