#K6836. Library Inventory Management

    ID: 32847 Type: Default 1000ms 256MiB

Library Inventory Management

Library Inventory Management

You are given a simulation of a library inventory management system. The system supports three operations:

  1. Add a book: Use a query in the format 0 x "title", where x is the unique integer identifier and title is the book title (enclosed in double quotes). This operation adds the book to the inventory.

  2. Remove a book: Use a query in the format 1 x to remove the book with identifier x from the inventory.

  3. Find a book: Use a query in the format 2 x to find the title of the book with identifier x. If the book is not found, output "Not found".

The operations are executed sequentially. For each find operation (type 2), you must output the result (book title or "Not found") on a new line.

All input is read from standard input (stdin) and all output is printed to standard output (stdout).

Note: If any mathematical expressions are needed, use LaTeX format (for example, x2x^2).

inputFormat

The first line contains an integer QQ — the number of queries. Each of the following QQ lines contains a query in one of the following formats:

  • For adding a book: 0 x "title".
  • For removing a book: 1 x.
  • For finding a book: 2 x.

Here, xx is an integer representing the book identifier, and "title" is a string (which may contain spaces) enclosed in double quotes. The input is provided via standard input (stdin).

outputFormat

For every find query (type 2), print the title of the book if it exists in the inventory; otherwise, print "Not found". Each result should be printed on a new line on standard output (stdout).## sample

6
0 1001 "Pride and Prejudice"
0 1002 "War and Peace"
0 1003 "1984"
2 1002
1 1003
2 1003
War and Peace

Not found

</p>