#K75462. Room Booking Scheduler

    ID: 34425 Type: Default 1000ms 256MiB

Room Booking Scheduler

Room Booking Scheduler

You are given a building with N available rooms and a sequence of booking requests. Each request is described by a room number and a time interval \( [start, end) \). A booking can be accepted if it does not overlap with any previously accepted booking in the same room. Otherwise, the request is rejected.

Two time intervals \( [s_1, e_1) \) and \( [s_2, e_2) \) do not overlap if and only if \( e_1 \le s_2 \) or \( e_2 \le s_1 \). Your task is to process each booking request in the given order and output either "Accepted" or "Rejected" for each request.

Note: All input will be read from standard input (stdin) and all output should be printed to standard output (stdout).

inputFormat

The first line of input contains an integer N representing the number of rooms available.

The second line contains an integer T representing the number of booking requests.

Each of the following T lines contains three integers: room_number, start, and end separated by spaces, describing a booking request.

\( 1 \leq room\_number \leq N \).

outputFormat

For each booking request, print either "Accepted" or "Rejected" on a new line indicating whether the request can be accommodated.

## sample
2
5
1 60 120
1 100 180
2 80 160
1 180 240
2 150 200
Accepted

Rejected Accepted Accepted Rejected

</p>