CURDPROD - CURD PRODUCERS

A curd manufacturing factory owns curd producing machines of different qualities. A curd producer of quality q produces 1 unit of curd in q units of time.

For example, a curd producer of quality 5 produces 1 unit of curd at time 5, 1 unit of curd at time 10 and so on.

Given the qualities of all the machines, find the minimum time required to produce T units of curd.

Input

The first line consists of an integer t, the number of test cases. For each testcase, the first line consists of 2 integers n and T, the number of machines and the target amount of curd. The next n lines consists of integers representing the qualities of the producer machines.

Output

For each test case, find the minimum time required to produce the target amount of curd.

Input Constraints:

1 <= t <= 10^2

1 <= n <= 10^4

1 <= T <= 10^9

1 <= quality of each machine <= 10^9

Note: Note that a quality 5 producer has produced only 1 curd at time 9 and not 1.8.

Sample

Input:
3
2 3
5
10
3 1000000
1
2
3
1 1000000000
1000000000

Output:
10
545455
1000000000000000000

Added by:cegprakash
Date:2014-11-06
Time limit:2s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: BF
Resource:Inspired from http://www.spoj.com/AU7/problems/AU7_2/

hide comments
2021-08-09 16:19:46
OMG !! 0.2 points straight.
2020-07-14 19:46:18
giving right output of test cases in idedone it ;but giving compilation error when submitting :(

reply: did u choose the right language before submitting ur solution? You can click on the error to see which line u get the compilation error and what didn't compile.

Last edit: 2021-01-27 14:52:43
2020-05-27 22:45:51
[spoiler removed]

Last edit: 2021-01-27 14:56:47
2019-11-28 02:00:39
Beware of extra whitespaces between input integers, line-based input routines will crash.
2018-10-16 17:58:33
This question is similar to MAIN8_c only we have to [spoiler]. Just [spoiler] and then do [spoiler] on it.

Last edit: 2019-01-05 12:30:09
2017-04-25 15:26:27
no need of [spoiler]

Last edit: 2019-01-05 12:30:39
2016-10-14 14:26:41
[spoiler] Works. When I assumed the[spoiler], I got a WA, but AC when I assumed [spoiler]. :)

Last edit: 2019-01-05 12:31:10
2015-07-30 20:18:48 Tej Bahadur Singh
how to use [censored] not getting point@@@@


Last edit: 2015-08-10 20:16:07
2015-07-05 21:10:13 DHEERAJ KUMAR
good one for .5 points :)
AC in one go :)
simple [censored]

Last edit: 2015-08-10 20:15:50
2015-03-22 06:02:58 Rajat (1307086)
@shilhargarg
Yes

Good question. Learned a new thing.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.