#C4785. Library Manager
Library Manager
Library Manager
You are given a series of operations to manage a library system. Each operation is in one of three forms: borrow x
, return x
, or check x
, where x is an integer representing the book ID. The borrow
operation marks a book as borrowed, return
marks it as returned, and check
outputs its current status. For each check
operation, output Borrowed
if the book is currently borrowed, or Available
if it is not.
The operations must be processed sequentially. This problem simulates a simple library management system using basic data structures.
inputFormat
The first line contains a single integer \( n \) \((1 \le n \le 10^5)\), which represents the number of operations. Each of the following \( n \) lines contains an operation in one of the following formats: borrow x
, return x
, or check x
, where \( x \) is an integer.
outputFormat
For each check
operation, output a single line containing either Borrowed
or Available
to indicate the current status of the book.
8
borrow 123
check 123
return 123
check 123
borrow 456
check 456
borrow 123
check 123
Borrowed
Available
Borrowed
Borrowed
</p>