infinity_hsn's blog

By infinity_hsn, history, 4 days ago, In English
input
1 3 7 19
2 3
2 5
4 4 4
output
12

In this problem, we have to find the minimum sum of burles Vasya will spend. According to this example, the output should be 12. Still, I think it is wrong because if we buy 5 tickets of the first type, he only has to pay 5 burles or the second way is to buy 2 tickets of the first type for the buses and the second type of ticket for the trolley, as they have the same number so they will be considered as 1. Therefore, we get 1*3 + 2*1 = 5. Can someone please tell me if am I right or I am missing something or the example is wrong?

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it