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?
So you think the example has been wrong for 11 years and nobody fixed it?
Wow, has this example been wrong for 11 years? Maybe it was a secret test of patience. But honestly, the argument seems interesting. Can anyone confirm?
Yes, because if you apply your brain then you would know that the minimum number of burles is 5 and not 12 in example 1. You can take pen and paper and solve it by your self.
this example can't be wrong, I think in 11 years at least one person would have noticed that it is wrong
Bro tell me why is 12 the right answer?
the first type of ticket only allows for 1 ride on 1 transport. So you need 19 tickets of first type and not 5 as you said.
Bro the question says that the line third and fourth are bus numbers and not the number of busses.
You have to spend 2 burles for the first bus ($$$C_1 * 2$$$)
Take the unlimited number of rides for the second bus ($$$C_2 * 1$$$)
Take the unlimited number of rides for all the trolleys ($$$C_3 * 1$$$)
The result will be 12, you can see that this is the minimum possible cost
Bro I agree with this but the question mentions that the output should be the minimum number of burles.
I think you misunderstood the problem
The numbers
2 5
and3 3 3
are not the number of the bus or the trolleyIt is the number of how many times Vasya will take the $$$i_{th}$$$ bus or trolley
Bro then what is 2 3 In the second line
This is the number of buses and trolleys respectively
There are 2 buses and 3 trolleys
Vasya will take the first bus 2 times and the second bus 5 times
Vasya will take the first trolley 4 times, the second trolley 4 times and the third trolley 4 times
I hope you got it now ^_^
You are right, but you typed 3 instead of 4.
My bad, I edited the comment, thank you ^_^
Thanks bro. And one more thing you can reply any moment but when I want to reply it says that "You can write no more than 1 comments in 10 minutes. Why?
You're welcome
I really don't know why is that happening, but I think it is a rating-related anti-spam technique