Speed Limit
This commit is contained in:
10
speedlimit.py
Normal file
10
speedlimit.py
Normal file
@@ -0,0 +1,10 @@
|
||||
n = int(input())
|
||||
while n > 0:
|
||||
time = 0
|
||||
dist = 0
|
||||
for _ in range(n):
|
||||
s, t = list(map(int, input().split()))
|
||||
dist += s * (t - time)
|
||||
time = t
|
||||
print(f"{dist} miles")
|
||||
n = int(input())
|
||||
Reference in New Issue
Block a user