Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


def prime_factorize(x):
    res = []
    i = 2
    while i * i <= x:
        if x % i:
            continue
        res.append([i, 0])
        while x % i == 0:
            x //= i
            res[-1][1] += 1
        i += 1
    if x != 1:
        res.append([x, 1])
    return res


cd = gcd(A, B)
ans = len(prime_factorize(cd)) + 1
print(ans)


Fixed submission:
def main():
    A, B = map(int, input().split())

    def gcd(x, y):
        while y != 0:
            x, y = y, x % y
        return x

    def prime_factorize(n):
        arr = []
        temp = n
        for i in range(2, int(-(-(n ** 0.5) // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])

        if temp != 1:
            arr.append([temp, 1])


        return arr

    cd = gcd(A, B)
    ans = len(prime_factorize(cd)) + 1
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
import numpy as np

# List=[15,25,30]
# print(reduce(gcd,List))
a, b = map(int, input().split())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    # divisors.sort()
    return divisors


list_a = make_divisors(a)
list_b = make_divisors(b)

# print(list_a, list_b)
cd = set(list_a) & set(list_b)
# print(cd)

# c = 0
# for i in range(len(cd) - 1):
#     if gcd(cd[i], cd[i + 1]) == 1:
#         c += 1

# print(c + 1)


def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2, N + 1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


# print(seachPrimeNum(100))
pnl = set(seachPrimeNum(max(cd)))
print(len(cd & pnl) + 1)

Fixed submission:
def main():
    A, B = map(int, input().split())

    def gcd(x, y):
        while y != 0:
            x, y = y, x % y
        return x

    def prime_factorize(n):
        arr = []
        temp = n
        for i in range(2, int(-(-(n ** 0.5) // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])

        if temp != 1:
            arr.append([temp, 1])


        return arr

    cd = gcd(A, B)
    ans = len(prime_factorize(cd)) + 1
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
s = input()
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
flag = True
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]

for i in range(1,n+1):
    x = a.count(i)
    if k-q+x > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]
  a_count = a.count

  for i in range(1,n+1):
    x = a_count(i)
    if k-q+x > 0:
      print('Yes')
    else:
      print('No')


if __name__ == '__main__':
  main()


Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy python submission (verdict: Runtime Error):
def main():
  
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]
  a_count = a.count

  for i in range(1,n+1):
    x = a_count(i)
    if k-q+x > 0:
      print('Yes')
      else:
        print('No')


if __name__ == '__main__':
    main()

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
a_count = a.count

for i in range(1,n+1):
    x = a_count(i)
    if k-q+x > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy python submission (verdict: Runtime Error):
def main():
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]

  for i in range(1,n+1):
    x = a.count(i)
    if k-q+x > 0:
      print('Yes')
      else:
        print('No')

if __name__ == '__main__':
    main()

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]

for i in range(1,n+1):
    x = a.count(i)
    if k-q+x > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
  print(0)
else:
  print(n(n-1)//2)

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p2 = [ i + 1 for i in range(n-1)]
p2.append(0)
print(sum(p2))

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p2 = [ i + 1 for i in range(n-1)]
p2.append(0)
print(sum(p2))

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
#l = [ i+1 for i in range(n) ]
p = [i+1 for i in range(n)]
p.append(1)
p.pop(0)
p_array = np.array(p)
#print(sum(l % p_array))
print(sum(p_array - 1))

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
#l = [ i+1 for i in range(n) ]
p = [i+1 for i in range(n)]
p.append(1)
p.pop(0)
p_array = np.array(p)
#print(sum(l % p_array))
print(sum(p_array - 1))

Fixed submission:
n = int(input())
print(n*(n-1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
l = [ i+1 for i in range(n) ]
p = [i+1 for i in range(n)]
p.append(1)
p.pop(0)
p_array = np.array(p)
print(sum(l % p_array))

Fixed submission:
n = int(input())
print(n*(n-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)



Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 7)

N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)


Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 7)

N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)


Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        c[u] += c[v]
        dfs(u, v)


N, Q = map(int, input().split())
to = [[] for i in range(N)]  # 隣接リスト
c = [0] * N

for i in range(N - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    c[p] += x
dfs(0)
print(*c)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

N, M = map(int, input().split())
dic = {}
for i in range(N):
    A, B = map(int, input().split())
    if A not in dic:
        dic[A] = [-B]
    else:
        dic[A].append(-B)
# print(dic, sorted(dic.keys()))

ans = 0
heap = []

for i in range(M):
    # print(i)
    if i + 1 in dic:
        heap.extend(dic[i + 1])
    heapq.heapify(heap)
    # print(heap)
    if heap:
        ans = ans - heapq.heappop(heap)

print(ans)


Fixed submission:
import heapq

N, M = map(int, input().split())
dic = {}
for i in range(N):
    A, B = map(int, input().split())
    if A not in dic:
        dic[A] = [-B]
    else:
        dic[A].append(-B)
# print(dic, sorted(dic.keys()))

ans = 0
heap = []

for i in range(M):
    # print(i)
    if i + 1 in dic:
        for j in dic[i + 1]:
            heapq.heappush(heap, j)
    # print(heap)
    if heap:
        ans = ans - heapq.heappop(heap)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import heapq

N, M = map(int, input().split())
dic = {}
for i in range(N):
    A, B = map(int, input().split())
    if A not in dic:
        dic[A] = [-B]
    else:
        dic[A] += [-B]

ans = 0
heap = []

for i in range(M):
    # print(i)
    if i + 1 in dic:
        heap += dic[i + 1]
    heapq.heapify(heap)
    # print(heap)
    if heap:
        ans += -heapq.heappop(heap)

print(ans)


Fixed submission:
import heapq

N, M = map(int, input().split())
dic = {}
for i in range(N):
    A, B = map(int, input().split())
    if A not in dic:
        dic[A] = [-B]
    else:
        dic[A].append(-B)
# print(dic, sorted(dic.keys()))

ans = 0
heap = []

for i in range(M):
    # print(i)
    if i + 1 in dic:
        for j in dic[i + 1]:
            heapq.heappush(heap, j)
    # print(heap)
    if heap:
        ans = ans - heapq.heappop(heap)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


def main():
    R, G, B, N = map(float, input().split())
    cnt = 0

    for r in range(0, 3000 // int(R) + 1):
        for g in range(0, 3000 // int(G) + 1):
            b = (N - R * r - G * g) / B
            # print(b)
            if b >= 0 and is_integer_num(b):
                # print(r, g, b)
                cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()


Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


def main():
    R, G, B, N = map(float, input().split())
    cnt = 0

    for r in range(0, 3000 // int(R) + 1):
        for g in range(0, 3000 // int(G) + 1):
            b = (N - R * r - G * g) / B
            # print(b)
            if b >= 0 and is_integer_num(b):
                # print(r, g, b)
                cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(float, input().split())
cnt = 0


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


for r in range(0, 3000 // int(R) + 1):
    for g in range(0, 3000 // int(G) + 1):
        b = (N - R * r - G * g) / B
        # print(b)
        if b >= 0 and is_integer_num(b):
            # print(r, g, b)
            cnt += 1

print(cnt)


Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


def main():
    R, G, B, N = map(float, input().split())
    cnt = 0

    for r in range(0, 3000 // int(R) + 1):
        for g in range(0, 3000 // int(G) + 1):
            b = (N - R * r - G * g) / B
            # print(b)
            if b >= 0 and is_integer_num(b):
                # print(r, g, b)
                cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))


Fixed submission:
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)


# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
if len(first_digit) == 0:
    print(t)
else:
    print(t - (10 - min(first_digit)))

Buggy python submission (verdict: Runtime Error):
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))

Fixed submission:
n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)


# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
if len(first_digit) == 0:
    print(t)
else:
    print(t - (10 - min(first_digit)))
Buggy python submission (verdict: Time Limit Exceeded):
import re

n, q = map(int, input().split())
s = input()

ans = [0] * q

for i in range(q):
    l, r = map(int, input().split())
    sl = s[l - 1 : r]
    # sl = sl.replace("AC", "-")
    # ans = sl.count("-")
    # print(ans)

    result = re.findall(r"AC", sl)
    # print(len(result))
    ans[i] = len(result)
print(*ans, sep="\n")


Fixed submission:
n, q = map(int, input().split())
s = input()

t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i : i + 2] == "AC" else 0)
# print(t)
for j in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])

Buggy python submission (verdict: Time Limit Exceeded):
import re

n, q = map(int, input().split())
s = input()

for i in range(q):
    l, r = map(int, input().split())
    sl = s[l - 1 : r]
    # sl = sl.replace("AC", "-")
    # ans = sl.count("-")
    # print(ans)

    result = re.findall(r"AC", sl)
    print(len(result))


Fixed submission:
n, q = map(int, input().split())
s = input()

t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i : i + 2] == "AC" else 0)
# print(t)
for j in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()

for i in range(q):
    l, r = map(int, input().split())
    sl = s[l - 1 : r]
    sl = sl.replace("AC", "-")
    ans = sl.count("-")
    print(ans)


Fixed submission:
n, q = map(int, input().split())
s = input()

t = [0] * (n + 1)
for i in range(n):
    t[i + 1] = t[i] + (1 if s[i : i + 2] == "AC" else 0)
# print(t)
for j in range(q):
    l, r = map(int, input().split())
    print(t[r - 1] - t[l - 1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, W = map(int, input().split())
    w = [0]
    v = [0]
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    dp = [[0] * (W + 1) for _ in range(N + 1)]


    for i in range(1, N + 1):
        for j in range(1, W + 1):
            if j - w[i] < 0:
                dp[i][j] = dp[i - 1][j]
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
    # print(w, v, dp)
    print(dp[N][W])


if __name__ == "__main__":
    main()


Fixed submission:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N, W = map(int, input().split())
    w = [0]
    v = [0]
    for i in range(N):
        weight, value = map(int, input().split())
        w.append(weight)
        v.append(value)

    dp = [[0] * (W + 1) for _ in range(N + 1)]


    for i in range(1, N + 1):
        for j in range(1, W + 1):
            if j - w[i] < 0:
                dp[i][j] = dp[i - 1][j]
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + v[i])
    # print(w, v, dp)
    print(dp[N][W])


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    s = input()
    t = input()

    """
    dp[i][j] := s[1] ... s[i] と t[1] ... t[j] に対するLCSの長さ
    
    s[i+1] == t[i+1]のとき、dp[i+1][j+1]は dp[i][j]+1, dp[i+1][j], dp[i][j+1]のいずれか  
    dp[i+1][j+1] = max(dp[i][j] + 1, dp[i+1][j], dp[i][j+1])

    それ以外の時
    dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
    """

    dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]

    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i + 1][j + 1] = max(dp[i][j] + 1, dp[i + 1][j], dp[i][j + 1])
            else:
                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])

    ans = ""
    x = len(s)
    y = len(t)
    while x >= 1 and y >= 1:
        if dp[x][y] == dp[x - 1][y]:
            x -= 1
        elif dp[x][y] == dp[x][y - 1]:
            y -= 1
        else:
            x -= 1
            y -= 1
            ans = s[x] + ans

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    s = input()
    t = input()

    """
    dp[i][j] := s[1] ... s[i] と t[1] ... t[j] に対するLCSの長さ
    
    s[i+1] == t[i+1]のとき、dp[i+1][j+1]は dp[i][j]+1, dp[i+1][j], dp[i][j+1]のいずれか  
    dp[i+1][j+1] = max(dp[i][j] + 1, dp[i+1][j], dp[i][j+1])

    それ以外の時
    dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
    """

    dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]

    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i + 1][j + 1] = max(dp[i][j] + 1, dp[i + 1][j], dp[i][j + 1])
            else:
                dp[i + 1][j + 1] = max(dp[i + 1][j], dp[i][j + 1])

    ans = ""
    x = len(s)
    y = len(t)
    while x >= 1 and y >= 1:
        if dp[x][y] == dp[x - 1][y]:
            x -= 1
        elif dp[x][y] == dp[x][y - 1]:
            y -= 1
        else:
            x -= 1
            y -= 1
            ans = s[x] + ans

    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
x, y = int(input())
print(x + y//2 )


Fixed submission:
x, y = map(int, input().split())
print(x + y//2 )
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from fractions import gcd

n, x_ini = map(int, input().split())
x = list(map(int, input().split()))

x += [x_ini]

# print(x)

x2 = [x[i] - min(x) for i in range(n + 1)]

# print(x2)

x_ini -= min(x)

# print(x_ini)

ans = reduce(gcd, x2)

print(ans)


Fixed submission:
from functools import reduce
from fractions import gcd

n, x_ini = map(int, input().split())
x = [abs(x_ini - int(i)) for i in input().split()]

ans = reduce(gcd, x)

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np

x1, y1, x2, y2 = map(int, input().split())

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten()+' '+*d.flatten())

Fixed submission:
import numpy as np

x1, y1, x2, y2 = map(int, input().split())

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten(), end=" ")
print(*d.flatten())

Buggy python submission (verdict: Runtime Error):
import numpy as np

x1, y1, x2, y2 = map(int, input().split())

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten(), *d.flatten(), sep=" ")

Fixed submission:
import numpy as np

x1, y1, x2, y2 = map(int, input().split())

a = np.array([[x1], [y1]])
b = np.array([[x2], [y2]])

rot = np.array([[0, -1], [1, 0]])
ab = b - a
bc = np.dot(rot, ab)

c = b + bc
d = a + bc

# print(a, b)
# print(c, d)

print(*c.flatten(), end=" ")
print(*d.flatten())