27 lines
416 B
Python
27 lines
416 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
|
||
|
def maximal_distance(A):
|
||
|
if len(A) == 0:
|
||
|
return None
|
||
|
|
||
|
max_n = A[0]
|
||
|
min_n = A[0]
|
||
|
|
||
|
for i in range(1,len(A)):
|
||
|
if max_n < A[i]:
|
||
|
max_n = A[i]
|
||
|
elif min_n > A[i]:
|
||
|
min_n = A[i]
|
||
|
|
||
|
return max_n - min_n
|
||
|
|
||
|
A = []
|
||
|
for line in sys.stdin:
|
||
|
if line[0] == '\n':
|
||
|
break
|
||
|
A.append(int(line))
|
||
|
|
||
|
print(maximal_distance(A))
|