#C9098. Room Booking Checker

    ID: 53153 Type: Default 1000ms 256MiB

Room Booking Checker

Room Booking Checker

This problem requires you to determine if a study room can be booked for a requested time slot given a set of available time intervals. A booking request is successful only if there exists an availability interval that completely covers the request. In other words, given an availability interval \([a, b]\) and a request \([c, d]\), the booking is successful if and only if \(a \le c\) and \(d \le b\).

Your task is to process the input, check each booking request, and output whether the room can be booked accordingly.

inputFormat

The input consists of the following:

  • The first line contains an integer \(N\), the number of available time intervals.
  • The next \(N\) lines each contain two integers representing the start and end times (inclusive) of an available interval.
  • The following line contains an integer \(M\), the number of booking requests.
  • The next \(M\) lines each contain two integers representing the start and end times (inclusive) of a booking request.

outputFormat

Output exactly \(M\) lines. Each line should contain either "True" or "False" indicating whether the corresponding booking request can be fulfilled (i.e., if there exists an interval in which the request fits entirely).

## sample
2
9 12
14 17
4
9 10
11 13
14 16
17 18
True

False True False

</p>