#C2850. Crop Trading Challenge

    ID: 46212 Type: Default 1000ms 256MiB

Crop Trading Challenge

Crop Trading Challenge

You are given a list of crop values, an initial crop value, and the number of available trades. In each test case, you must determine the maximum number of trades that can be performed. Since each trade uses one available trade, the answer is simply equal to the available trades.

In mathematical form, if \( A \) represents the number of available trades, then the maximum number of trades, \( T_{max} \), is given by:

[ T_{max} = A ]

The list of crop values and the initial crop value are provided for context, but the trading mechanism in this problem does not depend on them.

inputFormat

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

T
N_1
c_11 c_12 ... c_1N
initial_crop_value_1 available_trades_1
N_2
c_21 c_22 ... c_2N
initial_crop_value_2 available_trades_2
... (and so on for T test cases)

Where:

  • T is the number of test cases.
  • For each test case, N is the number of crop values.
  • The next line contains N integers representing the crop values.
  • The next line contains two integers: the initial crop value and the number of available trades.

outputFormat

For each test case, output a single integer representing the maximum number of trades that can be performed. The output for each test case should be printed on its own line to standard output.

## sample
3
5
10 20 30 40 50
20 3
3
15 25 10
10 2
4
5 10 15 20
5 4
3

2 4

</p>