#C952. Order Fulfillment Checker

    ID: 53622 Type: Default 1000ms 256MiB

Order Fulfillment Checker

Order Fulfillment Checker

You are given an inventory list and a list of orders. Each inventory record consists of an item identifier and its available quantity. Each order consists of an item identifier and a requested quantity. Determine for each order whether it can be fulfilled based on the inventory.

An order can be fulfilled if and only if the available quantity of the item is at least as large as the requested quantity, i.e. $$available \geq requested$$.

For example, if the inventory is [(1, 50), (2, 30), (3, 20), (4, 10)] and the orders are [(1, 20), (2, 40), (4, 10)], then the output should be:

Yes
No
Yes

inputFormat

The input is given via standard input (stdin) and has the following format:

  1. An integer n representing the number of items in the inventory.
  2. n lines follow, each containing two integers: the item identifier and its available quantity.
  3. An integer m representing the number of orders.
  4. m lines follow, each containing two integers: the item identifier and the requested quantity.

Note: All numbers are separated by spaces and/or newlines.

outputFormat

For each order, output a single line with Yes if the order can be fulfilled, or No otherwise. The outputs must be printed to standard output (stdout), each on its own line.

## sample
4
1 50
2 30
3 20
4 10
3
1 20
2 40
4 10
Yes

No Yes

</p>