classSolution{public:intdistanceTraveled(intmainTank,intadditionalTank){// M M M M M A M M M M A// 1 [2 3 4 5] 6 [7 8 9 10] 11return(mainTank+min((mainTank-1)/4,additionalTank))*10;}};
1234567
classSolution{publicintdistanceTraveled(intmainTank,intadditionalTank){// M M M M M A M M M M A// 1 [2 3 4 5] 6 [7 8 9 10] 11return(mainTank+Math.min((mainTank-1)/4,additionalTank))*10;}}
12345
classSolution:defdistanceTraveled(self,mainTank:int,additionalTank:int)->int:# M M M M M A M M M M A# 1 [2 3 4 5] 6 [7 8 9 10] 11return(mainTank+min((mainTank-1)//4,additionalTank))*10