+ 1
New Driver's License You have to get a new driver's license and you show up at the office at the same time as 4 other people.
name = input() agents = int(input()) clients = input() clients = clients.split() clients.append(name) clients.sort(reverse=True) time = 0 reminder = True while reminder: for i in range(agents): if clients[-1] == name: reminder = False break clients.pop() time += 1 print(time * 20)
2 Answers
+ 1
name = input()
agents = int(input())
clients = input()
clients = clients.split()
clients.append(name)
clients.sort(reverse=True)
time = 0
reminder = True
while reminder:
for i in range(agents):
if clients[-1] == name:
reminder = False
break
clients.pop()
time += 1
print(time * 20)
+ 1
# Hi! If itâs just shorter code you want, you can compare with this one:
name, agents, other = (input() for i in range(3))
print(20 * (1 + sorted(f"{name} {other}".split()).index(name)//int(agents)))