#K5881. Bench Seating Validation

    ID: 30725 Type: Default 1000ms 256MiB

Bench Seating Validation

Bench Seating Validation

In this problem, you are given several test cases. For each test case, a number of benches are provided along with their seating capacities and current occupancies. Your task is to determine whether every bench in a test case meets the seating constraint, i.e., the number of occupants does not exceed the bench's capacity.

Mathematically, for each bench \(i\), let \(c_i\) be the capacity and \(p_i\) be the current number of occupants. The condition to satisfy is:

\(p_i \le c_i\)

Print YES if all benches in a test case are within their capacity; otherwise, print NO.

inputFormat

The input begins with an integer \(T\) representing the number of test cases.

Each test case follows with:

  • An integer \(N\) indicating the number of benches.
  • A line with \(N\) integers representing the capacities of the benches.
  • A line with \(N\) integers representing the current number of occupants on each bench.

All input is read from standard input.

outputFormat

For each test case, output a single line containing YES if all benches adhere to their seating capacity, or NO if any bench is over-occupied.

Output the results to standard output.

## sample
3
3
4 5 2
3 5 2
4
3 3 4 5
3 4 2 5
5
2 4 3 6 5
2 5 3 6 4
YES

NO NO

</p>