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
hide comments
sk128:
2021-08-09 16:19:46
OMG !! 0.2 points straight. |
|
s_tank00_:
2020-07-14 19:46:18
giving right output of test cases in idedone it ;but giving compilation error when submitting :(
|
|
ayush2407:
2020-05-27 22:45:51
[spoiler removed] Last edit: 2021-01-27 14:56:47 |
|
nadstratosfer:
2019-11-28 02:00:39
Beware of extra whitespaces between input integers, line-based input routines will crash. |
|
victor_ludorum:
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 |
|
vengatesh15:
2017-04-25 15:26:27
no need of [spoiler] Last edit: 2019-01-05 12:30:39 |
|
dwij28:
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 |
|
Tej Bahadur Singh :
2015-07-30 20:18:48
how to use [censored] not getting point@@@@
|
|
DHEERAJ KUMAR:
2015-07-05 21:10:13
good one for .5 points :)
|
|
Rajat (1307086):
2015-03-22 06:02:58
@shilhargarg
|
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/ |