#C194. Digital Library Manager

    ID: 45200 Type: Default 1000ms 256MiB

Digital Library Manager

Digital Library Manager

You are required to implement a digital library manager. The manager must be able to store book information and process queries. Each book record contains a title, author, year, and ISBN.

The program will support three types of operations:

  • ADD: Add a book to the library. The command format is: ADD title;author;year;isbn
  • FIND: Find books whose titles contain a given substring (case-insensitive). The command format is: FIND partial_title. If no book is found, output No match found.
  • LIST: List all books sorted alphabetically by title. The command is simply: LIST.

For FIND and LIST commands, output each matching book on a separate line in the format:

$$\text{title};\text{author};\text{year};\text{isbn} $$

Input is read from standard input and output must be printed to standard output.

inputFormat

The input begins with an integer q denoting the number of operations. Each of the following q lines represents a command which can be one of the following:

  • ADD title;author;year;isbn
  • FIND partial_title
  • LIST

For the ADD command, the book details are separated by semicolons.

outputFormat

For each FIND and LIST command, print the resulting list of books with each book on a separate line in the following format:

$$\text{title};\text{author};\text{year};\text{isbn} $$

If a FIND command does not match any books, print a single line with No match found.

## sample
5
ADD Python Programming;John Smith;2015;123-456-789
ADD Learn Java;Jane Doe;2017;987-654-321
FIND python
LIST
FIND C
Python Programming;John Smith;2015;123-456-789

Learn Java;Jane Doe;2017;987-654-321 Python Programming;John Smith;2015;123-456-789 No match found

</p>