Under construction

Still being built. Things may change

Sales Tax

Time limit1sMemory limit512 MB

Summary
Given item prices and the dollar part of a receipt total, find the minimum and maximum sales tax values that fit the receipt.
Level

Medium5 of 10

Topics
Math, Binary search, Implementation
Solved
No attempts yet

Problem

Albert noticed something new on a receipt while traveling in a new city. The currency there is the dollar, but the city also uses the cent (c), which is 1/100 of a dollar. So 100 cents equal 1 dollar, and no unit smaller than a cent is used. For example, a price of 4.30 means 4 dollars and 30 cents, and 5.00 can be read as 5 dollars, 500 cents, or 3 dollars and 200 cents.

The receipt lists the total paid for the NN items Albert bought, including sales tax. Let PiP_i be the price of the ii-th item. Item prices exclude tax. The final payment XX is the sum of the item prices plus tax equal to FF% of that sum, where FF is known to be a non-negative integer. Part of the receipt is torn, so the cent digits of XX are not visible and only the dollar amount is known.

For example, let N=3N = 3, X=13X = 13, and P=[2.00,4.49,3.51]P = [2.00, 4.49, 3.51].

  • If F=25F = 25: the item total is 10 dollars, the tax is 25% of that, or 2.50, so the total payment is 12.50.
  • If F=30F = 30: the tax is 3.00, so the total payment is 13.00.
  • If F=39F = 39: the tax is 3.90, so the total payment is 13.90.
  • If F=40F = 40: the tax is 4.00, so the total payment is 14.00.

Since X=13X = 13 here, the possible tax rate FF is at least 30 and less than 40.

Albert checked another receipt and found something new. As noted, no unit smaller than a cent is used, so if the tax has a fraction of a cent, each store may round it up or down to the nearest cent. The receipt does not say which rule the store used. For example, let N=3N = 3, X=19X = 19, and P=[1.98,9.99,4.99]P = [1.98, 9.99, 4.99].

  • The item total is 16.96.
  • If F=10F = 10: the tax is 1.696. The last digit 6 is a tenth of a cent, so the tax may be rounded down to 1.69 or up to 1.70. The total is then 18.65 or 18.66. Since X=19X = 19, a 10% tax cannot match this receipt.
  • If F=12F = 12: the tax is 2.0352, which rounds to 2.03 or 2.04. The total is 18.99 or 19.00, so this receipt is consistent with a 12% tax.
  • If F=17F = 17: the tax is 2.8834, which rounds to 2.88 or 2.89. The total is 19.84 or 19.85, so this receipt is consistent with a 17% tax.

In this example, the dollar part of the total matches the receipt for every FF from 12 to 17 inclusive.

Given NN, XX, and the prices PP from the receipt, find the minimum and maximum tax values that match the dollar amount of XX.

Input

The first line contains the number of test cases TT.

The first line of each test case contains two integers NN and XX. The next NN lines contain the item prices PiP_i in order. Each price always has a decimal point and exactly two digits after it for cents.

Output

For each test case, print the minimum and maximum tax values that match, separated by a space, on one line.

Constraints

  • 1≤T≤101 \le T \le 10
  • 1≤N≤1051 \le N \le 10^5
  • 0≤X≤1080 \le X \le 10^8
  • 0.01≤Pi≤9.990.01 \le P_i \le 9.99 for every ii with 1≤i≤N1 \le i \le N
  • The minimum and maximum tax values for every test case are guaranteed to be between 0 and 10410^4 inclusive.

Examples1

  1. Example 1

    Input
    5
    3 13
    2.00
    4.49
    3.51
    3 19
    1.98
    9.99
    4.99
    4 1
    0.09
    0.20
    0.30
    0.40
    4 1
    0.10
    0.20
    0.30
    0.40
    4 0
    0.01
    0.01
    0.01
    0.01
    
    Expected output
    30 39
    12 17
    1 102
    0 99
    0 2399