Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
It is beneficial to take a ticket for 60 trips when the number of trips is more than 34:
34 trips in small change: 125*3 + 15*4 = 375 + 60 = 435 rub
35 trips in small change: 125*3 + 15*5 = 375 + 75 = 450
rub when trips are not taken into account in the remainder [35;39].
EDIT: Although the case with 39 trips will count for other reasons.
Here is my solution to this problem! Learning Python for a month
You know where to put
spaces def ticket_metro():
int(input("n = "))
t_1 = 1
t_10 = 10
t_60 = 60
if n % 60 >= 35:
t_1 = 0
t_10 = 0
t_60 = 1 + (n // 60)
print(t_1, t_10, t_60)
elif n % t_60 < 35:
if (n % 60) % 10 < 8:
t_60 = n // 60
t_10 = n % 60 // 10
t_1 = (n % 60) % 10
else:
t_60 = n // 60
t_10 = 1 + (n % 60 // 10)
t_1 = 0
print(t_1, t_10, t_60)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question