Viacheslav_Shevcenko

Ukraine
Joined Sep 24, 2023
Problems18
Submissions19
Andremaxico How did you manage to get such results? Maybe you misunderstood the problem. Here are a few possible outcomes in the example:
Selling first, second, third, then fourth ticket respectively: max(2 - 0, 0) * 37 + max(3 - 1, 0) * 45 + max(1 - 2, 0) * 46 + max(4 - 3, 0) * 30 = 194
Selling fourth, third, second, then first ticket respectively:max(4 - 0, 0) * 30 + max(1 - 1, 0) * 46 + max(3 - 2, 0) * 45 + max(2 - 3, 0) * 37 = 165
Selling second, first, fourth, then third ticket respectively(the maximum possible result):max(3 - 0, 0) * 45 + max(2 - 1, 0) * 37 + max(4 - 2, 0) * 30 + max(1 - 3, 0) * 46 = 232