#C6158. Calendar Reminders
Calendar Reminders
Calendar Reminders
You are given a list of calendar events and a list of query times. Each event is given in the format HH:MM EventDescription
, and each query is given in the format HH:MM
. For each query, print the event description that occurs at that time. If there are multiple events at the same time, consider only the last occurrence as valid. If there is no event at the query time, output No event
.
The time format follows \(\text{HH:MM}\) with 24-hour notation.
Input Format:
- The first line contains an integer \(N\), the number of events.
- The next \(N\) lines contain the events in the format
HH:MM EventDescription
. - The following line contains an integer \(Q\), the number of queries.
- The next \(Q\) lines each contain a query time in the format
HH:MM
.
Output Format:
- For each query, output the corresponding event description if it exists, otherwise output
No event
. Each output should be on a new line.
inputFormat
The first line contains an integer N (number of events). The next N lines each contain a string in the format "HH:MM EventDescription". The next line contains an integer Q (number of queries). The following Q lines each contain a query time in the format "HH:MM".
outputFormat
Print Q lines. For each query, print the event description corresponding to that time if it exists. If not, print "No event".## sample
3
08:00 Breakfast
12:00 Lunch
18:30 Dinner
5
08:00
08:30
12:00
18:30
19:00
Breakfast
No event
Lunch
Dinner
No event
</p>