#K55577. Book Checkout Request Fulfillment

    ID: 30006 Type: Default 1000ms 256MiB

Book Checkout Request Fulfillment

Book Checkout Request Fulfillment

Given an inventory list of books and multiple checkout requests, determine for each request whether it can be fully fulfilled by the inventory.

Each checkout request is represented as a list of integers. A request is valid if, for every item \(i\), the number of copies requested \(r_i\) does not exceed the available inventory \(I_i\). In other words, a request is fulfilled if \(r_i \le I_i\) for all \(i\).

Output Yes if the checkout request can be fully satisfied, or No otherwise.

inputFormat

The input is read from standard input (stdin) with the following format:

  • The first line contains an integer n, the number of different items.
  • The second line contains n space-separated integers representing the inventory counts.
  • The third line contains an integer q, the number of checkout requests.
  • The next q lines each contain n space-separated integers representing a checkout request.

outputFormat

For each checkout request, print a single line to standard output (stdout) containing either Yes if the request can be fulfilled, or No otherwise.

## sample
3
4 3 2
3
2 1 1
3 2 2
5 1 0
Yes

Yes No

</p>