Chef and Burgerland
All submissions for this problem are available.
Chef runs a Burgerland in his city. Every weekend he visits the market to buy various ingredients for his stall. The amount of ingredients he buys depends upon his earnings in the previous week which is denoted by K. He is a very clever man so he always buys those ingredients which costs the minimum and adds the maximum to the taste of burgers. He knows the cost of each ingredient Ci and the taste value Ti corresponding to each ingredient (i).
The chef is busy running his burgerland this weekend so your task is to help him to procure the best possible ingredients.
The chef is busy running his burgerland this weekend so your task is to help him to procure the best possible ingredients.Note:- He can buy ingredients proportional to the money he has.
The first line contain Integer N (Total Number of Ingredients), second line contain Integer K(Amount of money he earned the previous week). The third line contains N distinct Integers i.e. cost of each ingredient (A0……….AN-1). The fourth line contains N distinct Integers i.e. taste of each ride (T0…………..TN-1).
The sum of the taste value of the ingredients he buys(with k amount of money). Note:- The precision of answer should be up to two decimal place.
10 20 30
60 100 120Output:
By taking full items of cost 10, 20 and 2/3rd of last item of cost 30
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, SCM qobi, ST, NICE, BASH, NEM, LISP sbcl, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions