Speeding
This commit is contained in:
18
speeding.py
Normal file
18
speeding.py
Normal file
@@ -0,0 +1,18 @@
|
||||
n = int(input())
|
||||
|
||||
prev_t = prev_d = None
|
||||
max_speed = 0
|
||||
for _ in range(n):
|
||||
t, d = map(int, input().split())
|
||||
|
||||
if prev_t is None:
|
||||
prev_t = t
|
||||
prev_d = d
|
||||
continue
|
||||
|
||||
speed = (d - prev_d) / (t - prev_t)
|
||||
max_speed = max((speed, max_speed))
|
||||
prev_t = t
|
||||
prev_d = d
|
||||
|
||||
print(int(max_speed))
|
||||
Reference in New Issue
Block a user