How to solve this problem?

Правка en3, от 444iq, 2019-09-07 10:42:29

answer will be 65 for the 2nd test case?

input 3.

1 , 2 , 4 , 8. and b = 3

fill 1 litre on day 1 and 3 on day 2 , total cost = 7.

my greedy approach of taking as much as we can in a given range with minimum cost fails.

my idea for input 3, fill 3 on day 1, and 1 on day 4 but it gives a cost of 11 which is not optimal.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский 444iq 2019-09-07 10:42:29 196
en2 Английский 444iq 2019-09-07 10:41:04 221
en1 Английский 444iq 2019-09-07 10:39:46 98 Initial revision (published)