Hi,
Can someone help me to solve this ? Sorry dont remember last test cases's answer exactly.
Sam likes to eat sweets because he is low on energy. In sheet shop there is P amount of sweets of P types, which has a cost Ci/kg and energy Ei/kg. Sam have total M amount.
You can eat only one type of sweet exactly 1 kg or less amount. if amount of sweet id coming as fraction then Energy will be E = (E/P) *(5^-1)%(10^9 +7)
Find out the maximum energy Sam can gain using the M amount.
: First line is the number of Sweets
: second line contains cost of sweets
: Third line contains the enery for sweets[i]
: total amount SAM has
TestCase:
3
5 3 1
7 8 9
4
Ans: 17 (can have the last two seweets 1 kg each)
Test case: 2
1
12
24
6
Ans: 12
Test case 3:
3
5 3 1
7 8 9
5
Ans: 17 + (7/5* (5^-1)%(10^9 +7))
** before someone down voting please specify the reason.