#C10634. Distributing Orders Among Warehouses

    ID: 39861 Type: Default 1000ms 256MiB

Distributing Orders Among Warehouses

Distributing Orders Among Warehouses

You are given n warehouses, each with a certain capacity, and m orders that need to be allocated among these warehouses. The task is to determine if it is possible to distribute all the orders without exceeding the capacity of any warehouse.

Mathematically, let the capacities be \(c_1, c_2, \dots, c_n\). If the condition \[ \sum_{i=1}^{n} c_i \ge m \] holds, then all orders can be distributed (output YES), otherwise they cannot (output NO).

inputFormat

The input is read from standard input and begins with an integer T representing the number of test cases. Each test case consists of two parts:

  1. The first line contains two integers n and m, where n is the number of warehouses and m is the number of orders.
  2. The second line contains n space-separated integers representing the capacities of the warehouses.

outputFormat

For each test case, output a single line containing YES if the orders can be distributed without exceeding the capacities, or NO otherwise.

## sample
1
3 10
5 8 2
YES

</p>