#K63242. Achieving Target Productivity

    ID: 31710 Type: Default 1000ms 256MiB

Achieving Target Productivity

Achieving Target Productivity

In this problem, you are given (n) employees, each having a certain productivity value. You are required to achieve an average productivity of at least (T). The deficit in total productivity is given by (\text{deficit} = T \times n - \sum_{i=1}^{n} P_i), where (P_i) is the productivity of the (i^{th}) employee. In order to meet the target, you can replace some employees at a specified cost. However, you cannot exceed the available budget (B). Your task is to determine if it is possible to achieve at least the target average productivity within the given budget. If it is possible, output YES; otherwise, output NO.

inputFormat

The input is given via standard input (stdin) and consists of three lines:

  • The first line contains three integers \(n\), \(T\), and \(B\), where \(n\) is the number of employees, \(T\) is the target average productivity, and \(B\) is the available budget.
  • The second line contains \(n\) integers representing the current productivity values of the employees.
  • The third line contains \(n\) integers representing the replacement cost for each employee.

outputFormat

Output via standard output (stdout) a single line: YES if it is possible to achieve an average productivity of at least (T) within the budget (B), and NO otherwise.## sample

5 15 100
10 20 5 30 25
10 5 20 15 25
YES