Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.
Problem hidden on 2011-03-21 10:31:33 by Oleg

SPRTFY - Sports factory

A factory produces two kinds of T-shirts (Al-Ahly t-shirt) & (Al-Zamalek t-shirt) . The production whose value is 130 pounds of Al-Ahly t-shirt needs (x1) meters of cotton and (y1) of working machines . and the production whose value is 110 pounds of Al-Zamalek t-shirt needs (x2)meters of cotton and (y2) of working machines .

find the greatest value of the production that is produced of (x) meters of cotton material and available time of (y) hours of working machines.

Input

the input contains three lines each line has two numbers

1st line :  x,y -> (total number of meters of cotton material,total hours of working machines).

2nd line : x1,y1 ->(number of meters of cotton , total hours of working machines) needed for Al-Ahly shirt.

3rd line :  x2,y2 ->(number of meters of cotton , total hours of working machines) needed for Al-Zamalek shirt. 

Output

single line of total profit factory can get by making Al-Ahly t-shirts and Al-Zamaklek t-shirts (make answer without decimal places)

Example

Input:
75 72
30 18
20 24
Output:
377
Input:
24.8  64.2
36.6  93.1 
30.4  91.5
Output:
88.0874
88
 Explaination : the best solution to make about (0.6776) from first kind and zero from second kind
Hint : try using linear programming
   Problem edited -> see output

Added by:Kawmia Institutes
Date:2011-01-27
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem

hide comments
2011-03-21 09:31:20 Oleg
Sorry, I also believe you have wrong solution. Or something wrong with your rounding.
Please compare my output and PM me, if you fix test cases.
2011-03-12 17:51:12 Shubham Kumar
how many test cases are there??
is there only one test case?
2011-02-16 09:12:53 yehia
I agree with ahmed 100% agree
2011-02-16 09:07:06 Ahmed Samir Hamza
i think your solution for this problem is wrong as this should be integer programming not linear programming and also your answer for second case is not the optimal if you accept fractions (not integer numbers of t-shirts), as the optimal is (0.612193*130.0)+(0.078741*110.0)=88.2466 but 0.6776*130.0=88.088.

please fix your solution and confirm it with someone who already study this kind of problems or remove this problem

what makes me believe that you solution is not correct is that you was accepting -ve number of t-shirts before (and you delete this case from sample)
2011-02-07 13:03:27 Mohamed Maher
i make it float and get ac
2011-02-05 19:16:39 Anshu Saurabh
what are the constraints??
2011-02-03 19:00:24 Made Aryadinata
About second example:
If we make 0.6776 from first kind, we need 63.0846 hours... But the available time is only 14.2 hours?

sorry i wrote the test and didn't copy it
it was 64.2

Last edit: 2011-02-03 19:01:05
2011-02-03 19:00:24 Mark Gordon
The second example seems to make no sense. The machine hours required for each of the shirts prohibits us to making at most ~19 pounds it seems.

BY PS : How many T-shirts will u make in the second example from each kind?
another hint added to problem

Last edit: 2011-02-03 12:58:34
2011-02-03 19:00:24 Mohamed Maher
hint : try using linear programming
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.