Buggy python submission (verdict: Runtime Error):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0
for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = one_sa
    else:
        if one_sa % onesam == 0:
            continue
        else:
            short,big = min(onesam,one_sa),max(onesam,ne_sa)
            if short == 1:
                onesam =1
                break
                
            while big % short != 0:
                for i in range(2,short):
                    if short % i == 0:
                        short = short // i
            if short == 1:
                onesam = 1
                break
            else:
                onesam = short
print(onesam)

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Runtime Error):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0
for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = one_sa
    else:
        if one_sa % onesam == 0:
            continue
        else:
            short,big = min(onesam,one_sa),max(onesam,ne_sa)
            if short == 1:
                onesam =1
                break
                
            while big % short != 0:
                for i in range(2,short):
                    if short % i == 0:
                        short = short // i
            if short == 1:
                onesam = 1
                break
            else:
                onesam = short
print(onesam)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()
sa = []
onesam = 2000000000
for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if one_sa % onesam == 0:
        continue
    if onesam > one_sa:
        onesam = one_sa
        sa.append(one_sa)
        
    
sa.sort()
samin = min(sa)

flag = 0
while flag == 0:
    amari = 0
    for i in sa:
        amari += i % samin
        if amari != 0:
            break
            
    if amari == 0:
        flag = 1
        break
    else:
        for j in range(1,samin+1):
            if samin % j == 0:
                samin = samin // j
                break
print(samin)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Runtime Error):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()
sa = []
onesam = 2000000000
for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if one_sa % onesam == 0:
        continue
        
    if onesam > one_sa:
        onesam = one_sa
        
    
sa.sort()
samin = min(sa)

flag = 0
while flag == 0:
    amari = 0
    for i in sa:
        amari += i % samin
        if amari != 0:
            break
            
    if amari == 0:
        flag = 1
        break
    else:
        for j in range(1,samin+1):
            if samin % j == 0:
                samin = samin // j
                break
print(samin)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()
sa = []
for i in range(len(xl)-1):
    sa.append(xl[i+1] - xl[i])
sa.sort()
samin = min(sa)

flag = 0
while flag == 0:
    amari = 0
    for i in sa:
        amari += i % samin
        if amari != 0:
            break
            
    if amari == 0:
        flag = 1
        break
    else:
        for j in range(1,samin+1):
            if samin % j == 0:
                samin = samin // j
                break
print(samin)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()
sa = []
for i in range(len(xl)-1):
    sa.append(xl[i+1] - xl[i])
    
samin = min(sa)

flag = 0
while flag == 0:
    amari = 0
    for i in sa:
        amari += i % samin
        break
    if amari == 0:
        flag =1
        break
    else:
        for j in range(1,samin+1):
            if samin % j == 0:
                samin = samin // j
                break
print(samin)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)

Buggy python submission (verdict: Time Limit Exceeded):
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()
sa = []
for i in range(len(xl)-1):
    sa.append(xl[i+1] - xl[i])
    
samin = min(sa)

flag = 0
while flag == 0:
    amari = 0
    for i in sa:
        amari += i % samin
    if amari == 0:
        flag =1
        break
    else:
        for j in range(1,samin+1):
            if samin % j == 0:
                samin = samin // j
                break
print(samin)
        

Fixed submission:
n, x = map(int,input().split())
xl = list(map(int,input().split()))

xl.append(x)
xl.sort()

onesam = 0

if len(xl) == 1:
    print(abs(xl[0] - x))
    exit()

for i in range(len(xl)-1):
    one_sa = xl[i+1] - xl[i]
    if onesam == 0:
        onesam = abs(one_sa)
    else:
        short,big = min(onesam,one_sa),max(onesam,one_sa)
        if big % short == 0:
            onesam = short
            continue
        else:
            while big % short != 0:
                short = short -1
#                 for k in range(2,short+1):
#                     if short % k == 0:
#                         short = short // k
#                         break
            onesam = short
            
print(onesam)