#K5861. Overdue Books Detector
Overdue Books Detector
Overdue Books Detector
You are given the current date and a list of borrowed books with their return dates. A book is considered overdue if its return date is strictly earlier than the current date. Formally, a book with return date \( r \) is overdue if \( r < c \), where \( c \) is the current date provided.
Your task is to print the titles of all overdue books, each on a new line. If no book is overdue, print nothing.
inputFormat
The input is given via stdin in the following format:
<current_date> <n> <title_1>,<return_date_1> <title_2>,<return_date_2> ... <title_n>,<return_date_n>
Where:
<current_date>
is a string in the formatYYYY-MM-DD
.<n>
is an integer indicating the number of borrowed books.- Each of the next
n
lines contains a book's title and its return date (inYYYY-MM-DD
format) separated by a comma.
outputFormat
Output the titles of overdue books to stdout, each on a separate line. If there are no overdue books, output nothing.
## sample2023-10-25
2
To Kill a Mockingbird,2023-10-25
Pride and Prejudice,2023-10-26