26 lines
416 B
Python
Executable file
26 lines
416 B
Python
Executable file
#!/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))
|