#K79847. Employee Work Hours Checker

    ID: 35399 Type: Default 1000ms 256MiB

Employee Work Hours Checker

Employee Work Hours Checker

You are given a task to verify if employees have met the weekly work hours requirement. For each test case, the input specifies the number of days an employee worked and the minimum required total hours. Then, a list of hours worked on each day is provided.

Your task is to compute the total number of hours worked and determine whether the employee meets or exceeds the required hours. If the total hours worked is at least the required number, output YES. Otherwise, output NO x, where \(x = H - total\) is the additional number of hours needed.

Input Format:

  • The first line contains an integer \(T\) indicating the number of test cases.
  • For each test case, the first line contains two integers \(D\) and \(H\), where \(D\) is the number of days and \(H\) is the minimum required hours.
  • The next line contains \(D\) integers representing the hours worked on each day.

Output Format:

  • For each test case, output a single line.
  • If the total hours worked is at least \(H\), print YES.
  • If not, print NO x, where \(x = H - (\text{sum of hours})\).

inputFormat

The input is read from stdin and has the following format:

T
D1 H1
a11 a12 ... a1D1
D2 H2
a21 a22 ... a2D2
...
DT HT
aT1 aT2 ... aTDT

Where \(T\) is the number of test cases. For each test case, the first line contains two integers \(D\) and \(H\), and the second line contains \(D\) integers representing the number of hours worked on each day.

outputFormat

For each test case, output the result on a separate line to stdout. The output should be YES if the employee meets or exceeds the required hours; otherwise, it should be NO x, where \(x = H - (\text{total hours worked})\).

## sample
2
5 40
8 8 8 8 8
7 50
6 7 8 9 10 5 4
YES

NO 1

</p>