infinity_hsn's blog

By infinity_hsn, history, 3 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?

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

»
3 days ago, # |
  Vote: I like it +17 Vote: I do not like it

So you think the example has been wrong for 11 years and nobody fixed it?

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like 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?

  • »
    »
    3 days ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    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.

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

this example can't be wrong, I think in 11 years at least one person would have noticed that it is wrong

»
3 days ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Bro the question says that the line third and fourth are bus numbers and not the number of busses.

»
3 days ago, # |
  Vote: I like it +20 Vote: I do not like it

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

  • »
    »
    3 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Bro I agree with this but the question mentions that the output should be the minimum number of burles.

    • »
      »
      »
      3 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think you misunderstood the problem

      The numbers 2 5 and 3 3 3 are not the number of the bus or the trolley

      It is the number of how many times Vasya will take the $$$i_{th}$$$ bus or trolley

      • »
        »
        »
        »
        3 days ago, # ^ |
        Rev. 2   Vote: I like it 0 Vote: I do not like it

        Bro then what is 2 3 In the second line

        • »
          »
          »
          »
          »
          3 days ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          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 ^_^

          • »
            »
            »
            »
            »
            »
            3 days ago, # ^ |
              Vote: I like it +3 Vote: I do not like it

            You are right, but you typed 3 instead of 4.

          • »
            »
            »
            »
            »
            »
            3 days ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            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?

            • »
              »
              »
              »
              »
              »
              »
              3 days ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              You're welcome

              I really don't know why is that happening, but I think it is a rating-related anti-spam technique