For this Question: Given N cities in a line and your initial position, you want to visit all the cities at least once. You can go to one coordinate P to P+D or P-D where D is the number of steps which you choose initially. Your task is to find the maximum value of D such that you can visit all the cities at least once.The first line of input contains two integers N and X(initial position). The second line of input contains N space separated integers representing the location of cities.

Constraints:-
1 <= N <= 100000
1 <= City[] <= 100000000Print the maximum value of D such that you can visit all the cities.Sample Input:-
3 3
1 7 11

Sample Output:-
2

Sample Input:-
3 81
33 105 57

Sample Output:-
24, I have written this Solution Code: import math
b = []
N, P = input().split()
N = int(N)
P=int(P)
A = input().split()
for i in range(0,N):
    A[i] = int(A[i])-P
i=0
while(i<N-1):
    b.append(math.gcd(A[i],A[i+1]))
    i+=1
b.sort()
print (b[0]), In this Programming Language: Python, Now tell me if this Code is compilable or not?