Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03478 (python)

Fixed submission:
N, A, B = list(map(int, input().split()))
print(sum(i for i in range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Buggy submission (verdict: Runtime Error):
N , A, B = int(input().split())
S = str(N)
count = 0
s for a in S:
  s = [a for a in S]
i for i in range(S):
  Ns = sum(s[i])
if A <= Ns <= B:
  count += N
print(count)

Buggy submission (verdict: Runtime Error):
N, A, B = list(map(int,input().split()))
res = 0
for i in range(N+1):
  if A <= sum(int(s) for s in str(s)) <= B:
    res += i
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N+1):
  if A <= sum([int(s) for s in int(i)]) <= B:
    res += i
print(res)
Problem p03485 (python)

Fixed submission:
a,b = map(int,input().split())
x = -(-(a+b)//2)
print(x)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りでの入力
a, b = map(int,input().split)
#平均値の計算
ave = float((a+b)/2)
#数字の切り上げ
N = round(ave)
print({},"N")
Problem p03493 (python)

Fixed submission:
s = input()
n = 0
for a in s:
  if a =='1':
    n += 1
print(n)

Buggy submission (verdict: Runtime Error):
s = map(int, input().split())
n = 0
i = 0
cout = 0
for i in s:
  if s[i] % 2 == 0:
    cout += 1
  else:
    cout += 0
print(cout)
Problem p03494 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
 
i = 0
odd = 0
while odd == 0:
    for n in range(N):
        if a[n] % 2 == 0:
            a[n] /= 2
        else:
            odd = 1
            break
    if odd == 0:
        i += 1
print(i)

Buggy submission (verdict: Runtime Error):
n = input()
A = list(map(int,input().split()))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
while a % 2 == 0 in A:
  a /= 2
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a / 2]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
for i in input().split():
  if A[i] % 2 == 0:
    A[i] /= 2
  else:
    print(int(A[i]))

Buggy submission (verdict: Runtime Error):
s = map(int(input().split()))
n = 0
i = 0
cout = 0
for i in s:
  if s[i] % 2 == 0:
    cout += 1
  else:
    cout += 0
print(cout)
Problem p03545 (python)

Fixed submission:
a = list(input())
 
sign = "+-"
 
for i in range(2):  #1つめの正負
 for j in range(2):  #2つ目の正負
  for k in range(2):  #3つ目の正負
    if eval(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3] ) == 7:
     print(str(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3])+'=7')
     exit()

Buggy submission (verdict: Runtime Error):
N = input()
op_cnt = len(N) - 1 #隙間の個数
for i in range(2 ** op_cnt):
     op = ['-'] * op_cnt #とりあえず演算子は-を3つとしておく
     for j in range(op_cnt):
          if((i >> j) | 1):

Buggy submission (verdict: Runtime Error):
a = int(input())
a = list(str(a))

sign = "+-"

for i in range(2):  #1つめの正負
 for j in range(2):  #2つ目の正負
  for k in range(2):  #3つ目の正負
    if eval(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3] ) == 7:
     print(str(a[0]+sign[i]+a[1]+sign[j]+a[2]+sign[k]+a[3])+'=7')
Problem p03635 (python)

Fixed submission:
n,m = list(map(int,input().split()))
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
s = input()
a = len(s)-2
print(s[0]+a+s[len(s)-1])
Problem p03658 (python)

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort(reverse=True)
snake=0
for i in range(k):
  snake+=l[i]
print(snake)

Buggy submission (verdict: Runtime Error):
N ,K = map(int, input().split())
L = list(map(int, input().split()))
snake = 0
for i in range(K+1):
  snake += L[i]
print(snake)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
L = llst(map(int, input().split()))
sort.L(reverse = True)
print(sum(l in L for k in range(K+1)))
Problem p04030 (python)

Fixed submission:
s = input()
ans = ''
for i in range(len(s)):
	if s[i] == '0':
		ans += '0'    
	elif s[i] == '1':
		ans += '1'    
	else:
		if ans != '':
			ans = ans[:-1]    
print(ans)

Buggy submission (verdict: Runtime Error):
    s = input()
    ans = ''
    for i in range(len(s)):
        if s[i] == '0':
            ans += '0'
            
        elif s[i] == '1':
            ans += '1'
            
        else:
            if ans != '':
                ans = ans[:-1]
                
    print(ans)

Buggy submission (verdict: Runtime Error):
ans = []
a = list(input())
for i in range(len(a)):
	if(a[i] == '1'):
		ans.append('1')
	elif(a[i] == '0'):
		ans.append('0')
	elif(a[i] == 'B'):
		ans.pop()
print(''.join(ans))

Buggy submission (verdict: Runtime Error):
ans = []
a = list(input())
for i in range(len(a)):
	if(a[i] == '1'):
		ans.append('1')
	elif(a[i] == '0'):
		ans.append('0')
	elif(a[i] == 'B'):
		ans.pop()
print(''.join(ans))
Problem p02554 (python)

Fixed submission:
n = int(input())
print((10**n-2*9**n+8**n)%1000000007)

Buggy submission (verdict: Runtime Error):
n=int(input())
print((10**n-9**n*2+8**n)%(1e9+7))
Problem p02615 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = sorted(a, reverse=True)
ans = 0
for i in range(n-1):
    ans += b[(i+1)//2]
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = sorted(b, reverse=True)
ans = 0
for i in range(n):
    ans += b[(i+1)//2]
print(ans)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())

if(2*x <= y <= 4*x and y%2==0 and x <= 50):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x, y = int(map, input().split())

if(2*x <= y <= 4*x and y%2==0 and x <= 50):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x, y = int(map, input().split())

if((2*x <= y <= 4*x) and (y%2==0)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x, y = int(map, input().split())

if(2*x <= y <= 4*x and y%2==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x, y = int(map, input().split())

if(2*x <= y <= 4*x):
    print("Yes")
else:
    print("No")
Problem p02646 (python)

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
c = a + t * v
d = b + t * w


if(a > b):
    c = a - t * v
    d = b - t * w
    if(c <= d):
        print("YES")
    else:
        print("NO")
elif(a == b):
    print("YES")
else:
    c = a + t * v
    d = b + t * w
    if(c >= d):
        print("YES")
    else:
        print("NO")

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
d = b - a
e = v - w
f = d / e
if(d == 0):
    print("YES")
elif(d > 0):
    if(e == 0):
        print("NO")
    elif(d / e <= t and e > 0):
        print("YES")
    else:
        print("NO")
else:
    if(e == 0):
        print("NO")
    elif(d / (e*-1) <= t and (e*-1)>0):
        print("YES")
    else:
        print("NO")
Problem p02675 (python)

Fixed submission:
n = int(input())
i = n % 10
if(i == 3):
  print("bon")
elif(i == 0 or i == 1 or i == 6 or i == 8):
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
n = input()
i = n % 10
if(i == 3):
  print("bon")
elif(i == 0 or i == 1 or i == 6 or i == 8):
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
n = input()
i = n % 10
if(n == 3):
  print("bon")
elif(n == 0 or 1 or 6 or 8):
  print("pon")
else:
  print("hon")
Problem p02677 (python)

Fixed submission:
import math

a, b, h, m = map(int, input().split())
angle = 30*h - 5.5*m
if(angle >= 180):
  angle = 360 - angle
print((a**2+b**2-(2*a*b*math.cos(math.radians(angle))))**0.5)

Buggy submission (verdict: Runtime Error):
import math

a, b, h, m = map(int, input())
angle = 30*h - 6*m
if(angle >= 180):
  angle = 360 - angle

print(a**2+b**2-2*a*b*math.cos(angle))
Problem p02705 (python)

Fixed submission:
import math

print(int(input()) * 2 * math.pi)

Buggy submission (verdict: Runtime Error):
import math

print(int(input()) * 2 * math.pi())

Buggy submission (verdict: Runtime Error):
import math

print(int(input() * 2 * math.pi())

Buggy submission (verdict: Runtime Error):
import math

print(int(input() * 2 * math.pi)
Problem p02742 (python)

Fixed submission:
h, w = map(int, input().split())
if(h == 1 or w == 1):
  print(1)
else:
  print((h*w+1)//2)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
  print((h*w+1)//2)
Problem p02743 (python)

Fixed submission:
a, b, c = map(int, input().split())
if((c - a - b > 0) and ((c-a-b)**2 > 4*a*b)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if((c - a - b > 0) and ((c-a-b)**2 > 4ab)):
  print("Yes")
else:
  print("No")
Problem p02843 (python)

Fixed submission:
dp = [True] #i円の買い物ができるか
x = int(input())
for i in range(99):
  dp.append(False)
for i in range(100, x+1):
  if(i < 106):
    dp.append(True)
  else:
    if(dp[i-100] or dp[i-101] or dp[i-102] or dp[i-103] or dp[i-104] or dp[i-105]):
      dp.append(True)
    else:
      dp.append(False)
if(dp[x]):
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
dp = [Yes] #i円の買い物ができるか
for i in range(99):
  dp.append(No)
for i in range(100, x+1):
  if(i < 106):
    dp.append(Yes)
  else:
    if((dp[i-100] == Yes) or (dp[i-101] == Yes) or (dp[i-102] == Yes) or (dp[i-103] == Yes) or (dp[i-104] == Yes) or (dp[i-105] == Yes)):
      dp[i].append(Yes)
    else:
      dp[i].append(No)
print(dp[x])
Problem p02898 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if a[i] >= m:
     cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
  ifa[i] >= m:
     cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
  if(a[i] >= m:
     cnt += 1
print(cnt)
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
cnt = 0
for i in range(3):
  if(s[i]==t[i]):
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
cnt = 0
for i in range(3):
  if(s[i]==t[i]):
    cnt += 1
prirnt(cnt)
Problem p02923 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ca = []
cnt = 0
for i in range(len(a)-1):
  if(a[i]<a[i+1]):
    ca.append(cnt)
    cnt = 0
  else:
    cnt += 1
ca.append(0)
ans = max(max(ca), cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ca = []
cnt = 0
for i in range(len(a)-1):
  if(a[i]<a[i+1]):
    ca.append(cnt)
    cnt = 0
  else:
    cnt += 1
ans = max(max(ca), cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ca = []
cnt = 0
for i in range(len(a)-1):
  if(a[i]<a[i+1]):
    ca.append(cnt)
    cnt = 0
  else:
    cnt += 1
if(a[len(a)-2]>a[len(a)-1]):
  cnt += 1
ans = max(max(ca), cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input()))
ca = []
cnt = 0
for i in range(len(a)-1):
  if(a[i]<a[i+1]):
    ca.append(cnt)
    cnt = 0
  else:
    cnt += 1
if(a[len(a)-2]>a[len(a)-1]):
  cnt += 1
ans = max(max(ca), cnt)
print(ans)
Problem p02927 (python)

Fixed submission:
m, d = map(int, input().split())
cnt = 0
for i in range(1, m+1):
  for j in range(11, d+1):
    d_1 = j % 10
    d_10 = j // 10
    if((d_1 * d_10) == i and (d_1 >= 2 and d_10 >= 2)):
      cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
m, d = map(int, input())
cnt = 0
for i in range(m):
  for j in range(d):
    d_1 = d % 10
    d_10 = d // 10
    if(d_1 * d_10 == m):
      cnt += 1
print(cnt)
Problem p02934 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
aa = 0
for i in range(n):
  b = 1 / a[i]
  aa += b
ans = 1 / aa
print(ans)

Buggy submission (verdict: Runtime Error):
n = 1
a = list(map(int, input().split())
sum = 0
for i in range(n):
  b = 1 / a[i]
  sum += b
ans = 1 / sum
print(ans)

Buggy submission (verdict: Runtime Error):
n = 1
a = list(map, input().split())
sum = 0
for i in range(n):
  b = 1 / a[i]
  sum += b
ans = 1 / sum
print(ans)
Problem p02971 (python)

Fixed submission:
num = []
aaa = []
nmax = 0
n2max = 0
count = 0
n = int(input())
for i in range(n):
    a = int(input())
    aaa.append(a)
    if(nmax < a):
        n2max = nmax
        nmax = a
        count = 1
        num = [i]
    elif(nmax == a):
        count += 1
        num.append(i)
    elif(n2max < a):
        n2max = a
for i in range(len(aaa)):
    if(count >= 2) or (nmax != aaa[i]):
        print(nmax)
    else:
        print(n2max)

Buggy submission (verdict: Runtime Error):
num = []
for _ in range(int(input())):
    num.append(int(input()))

for i in range(len(num)):
    a = max(num[:i])
    b = max(num[i+1:])
    print(max(a, b))
Problem p02982 (python)

Fixed submission:
import math
n, d = [int(i) for i in input().split()]
dot = []
for _ in range(n):
  zahyo = list(map(int, input().split()))
  dot.append(zahyo)
cnt = 0
for i in range(n-1):
  for j in range(i+1, n):
    test = 0
    for k in range(d):
      test += pow(dot[i][k] - dot[j][k], 2)
    test_a = float(math.sqrt(test))
    test_b = int(math.sqrt(test))
    if(test_a == test_b):
      cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
n, d = [int(i) for i in input().split()]
dot = []
for _ in range(n):
  zahyo = list(map(int, input().split()))
  dot.append(zahyo)
cnt = 0
for i in range(n-1):
  for j in range(i+1, n):
    for k in range(d):
      test += pow(dot[i][k] - dot[j][k], 2)
    test_a = float(math.sqrt(test))
    test_b = int(math.sqrt(test))
    if(test_a == test_b):
      cnt += 1
print(cnt)
Problem p02988 (python)

Fixed submission:
n = int(input())
a = list(map(int ,input().split()))
cnt = 0
for i in range(1, n-1):
  hoge = [a[i-1], a[i], a[i+1]]
  if(max(hoge) != a[i] and min(hoge) != a[i]):
     cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int ,input().split()))
cnt = 0
for i in range(1, n-1):
  if(max(a[i-1:i+1]) != a[i] and min(a[i-1:i+1] != a[i]):
     cnt += 1
print(cnt)
Problem p02993 (python)

Fixed submission:
n = input()

flag = 0
for i in range(3):
  if(n[i] == n[i+1]):
    flag = 1
  if(flag == 1):
    print("Bad")
    break
if(flag == 0):
  print("Good")

Buggy submission (verdict: Runtime Error):
n = int(input())

flag = 0
for i in range(3):
  if(n[i] == n[i+1]):
    flag = 1
  if(flag == 1):
    print("Bad")
    break
if(flag == 0):
  print("Good")
Problem p03001 (python)

Fixed submission:
W, H, x, y = [int(i) for i in input().split()]
ans1 = W * H / 2
ans2 = 1 if (x*2==W and y*2==H) else 0
print(str(ans1) + " " + str(ans2))

Buggy submission (verdict: Runtime Error):
W, H, x, y = [int(i) for i in input).split()]
ans1 = W * H / 2
ans2 = 1 if x*2==W or y*2==H else 0
print(str(ans1) + " " + str(ans2))
Problem p03029 (python)

Fixed submission:
a, b = [int(i) for i in input().split()]
c =(a * 3 + b) // 2
print(c)

Buggy submission (verdict: Runtime Error):
a, b = [int(i) for input().split()]
c = (a * 3 + b) // 2
print(c)

Buggy submission (verdict: Runtime Error):
a, b = [int(i) for input().split()]
c = (a * 3 + b) // 2
print(c)
Problem p03079 (python)

Fixed submission:
a, b, c = map(int, input().split())
if(a==b==c):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if(a==b==c):
  print("Yes")
else:
  print("No")
Problem p03126 (python)

Fixed submission:
n, m = map(int, input().split())
cnt = 0
like = []
frag = 1
for i in range(n):
  s = list(map(int, input().split()))
  like.append(s[1:])
for i in range(m):
  for j in range(n):
    if(not(i+1 in like[j])):
      frag = 0
      break
  if(frag == 1):
    cnt += 1
  frag = 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = 0
like = []
frag = 1
for i in range(n):
  s = list(map(int, input().split()))
for i in range(m):
  for j in range(n):
    if(not(i+1 in like[j])):
      frag = 0
      break
  if(frag == 1):
    cnt += 1
  frag = 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = 0
like = []
frag = 1
for i in range(n):
  s = list(map(int, input().split()))
  like.append(s[1:])
for i in range(m):
  for j in range(n):
  	if(!(i+1 in like[j])):
      frag = 0
    if(frag == 0):
      break
  if(frag == 1):
    cnt += 1
print(cnt)
Problem p03136 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
if(max(a) >= (sum(a) - max(a))):
   print("No")
else:
   print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
if(max(a) > (sum(a) - max(a)):
   print("NO")
else:
   print("YES")
Problem p03160 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
dp = [1e9]*n
dp[0] = 0
for i in range(1, n):
  dp[i] = min(dp[i], dp[i-1] + abs(a[i] - a[i-1]))
  if i > 1:
    dp[i] = min(dp[i], dp[i-2] + abs(a[i] - a[i-2]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
dp = [1e9 for _ in range(n+1)]
#dp[i]...コストの最小
dp[0] = 0
dp[1] = a[0]
for i in range(n-1):
  dp[i+2] = min(dp[i+1] + abs(a[i+1] - a[i]), dp[i] + abs(a[i+2] - a[i]))
print(dp[n])
Problem p03206 (python)

Fixed submission:
n = int(input())
print("Christmas", end = " ")
while n < 25:
  print("Eve", end = " ")
  n += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
print(Christmas, end = " ")
while n < 25:
  print(Eve, end = " ")
  n += 1
Problem p03211 (python)

Fixed submission:
s = input()
list = [int(c) for c in s]
num = []
ans = 753
for i in range(len(list)-2):
	num.append((list[i] * 100) + (list[i+1] * 10) + list[i+2])
	if(num[i] >= 753):
		if(ans >= (num[i] - 753)):
			ans = num[i] - 753
	else:
		if(ans > (753 - num[i])):
			ans = 753 - num[i]
print(ans)

Buggy submission (verdict: Runtime Error):
nums = list(map(int, input().split()))
sums = [sum(nums[i:i+3]) for i in range(len(nums)-1)]
poyo = [abs(x-753) for x in sums]
print(min(poyo))

Buggy submission (verdict: Runtime Error):
nums = map(int, input().split())
sums = [sum(nums[i:i+3]) for i in range(len(nums)-1)]
poyo = [abs(x-753) for x in sums]
print(min(poyo))

Buggy submission (verdict: Runtime Error):
nums = map(int, input().split())
sums = [sum(nums[i:i+3] for i in range(len(nums)-1))]
poyo = [abs(x-753) for x in sums]
print(min(poyo))

Buggy submission (verdict: Runtime Error):
list = int(input().split())
num = []
ans = 753
for i in range(len(list)-2):
  num.append((list[i] * 100) + (list[i+1] * 10) + list[i+2])
  if(num[i] >= 753):
    if(ans >= (num[i] - 753)):
      ans = num[i] - 753
  else:
    if(ans > (753 - ans[i])):
      ans = 753 - ans[i]
print(ans)
Problem p03212 (python)

Fixed submission:
n = int(input())
def dfs(sss):
  if(int(sss) > n):
    return 0
  r = 1 if(all(sss.count(c) > 0 for c in '753')) else 0
  for c in '357':
    r += dfs(sss+c)
  return r
print(dfs('0'))

Buggy submission (verdict: Runtime Error):
n = int(input())
other = ['0', '1', '2', '4', '6', '8', '9']
def dfs(sss):
  if(int(sss) > n):
    return 0
  r = 1 if(sss == all(s.count(c) > 0 for c in '753')) else 0
  for c in '357':
    r += dfs(sss+c)
  return r
print(dfs('0'))
Problem p03260 (python)

Fixed submission:
a, b = [int(i) for i in input().split()]
if(a == 2) or( b == 2):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
    a, b = [int(i) for i in input().split()]
    if(a == 2 or b == 2):
      print("No")
    else:
      print("Yes")
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
  if a < b:
    a, b = b, a
  if b == 0:
    return a
  c = a % b
  return gcd(b, c)
n, x = [int(i) for i in input().split()]
point = list(map(int, input().split()))
dif = []

if(len(point) == 1):
  ans = abs(point[0] - x)
else:
  gcd_now = abs(point[0] - x)
  for i in range(len(point) - 1):
    dif.append(abs(point[i+1] - point[i]))
    gcd_now = gcd(gcd_now, dif[i])
  ans = gcd_now
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n, x = [int(i) for i in input().split()]
point = list(map(int, input().split()))
dif = []

if(len(point) == 1):
  ans = abs(point[0] - x)
else:
  gcd = abs(point[0] - x)
  for i in range(len(point) - 1):
    dif.append(abs(point[i+1] - point[i]))
    gcd = math.gcd(gcd, dif[i])
  ans = gcd
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n, x = [int(i) for i in input().split()]
point = list(map(int, input().split()))
dif = []

if(len(point) == 1):
  ans = abs(point[0] - x)
else:
  gcd = abs(point[0] - x)
  for i in range(len(point) - 1):
    dif.append(point[i+1] - point[i])
    gcd = math.gcd(gcd, dif[i])
  ans = gcd
print(ans)
Problem p03282 (python)

Fixed submission:
n = input()
k = int(input())

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1'):
        i += 1
        if(i == len(n)):
            break
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n = input()
k = int(input())

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1' or i + 1 < len(n)):
        i += 1
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
n = input()
k = int(input())

if(k == 1):
    print(n[0])
elif(len(n)==1):
    print(n)
elif(n[0]== '1'):
    i = 1
    while(n[i] == '1'):
        i += 1
    if(k <= i):
        print(1)
    else:
        print(n[i])
else:
    print(n[0])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
if(len(s)==1):
    print(s)
else:
    if(k == 1):
        print(s[0])
    else:
        if(s[0]=='1'):
            i = 1
            while(s[i]=='1'):
                i += 1
            print(s[i])
        else:
            print(s[0])
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())

if(a>b):
  print(a-1)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())

if(a>b):
  print(a-1)
else:
  print(a)
Problem p03423 (python)

Fixed submission:
print(int(input())//3)

Buggy submission (verdict: Runtime Error):
print(n//3)
Problem p03543 (python)

Fixed submission:
t = input()
if((t[0:1] == t[1:2] == t[2:3]) or (t[1:2] == t[2:3] == t[3:4])):
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if((t[0:1] == t[1:2] == t[2:3]) or (t[1:2] == t[2:3] == t[3:4])):
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if((t[0:1] == t[1:2] == t[2:3]) or (t[1:2] == t[2:3] == t[3:4]):
   print("Yes")
else:
   print("No")
Problem p03550 (python)

Fixed submission:
n, z, w = map(int, input().split())
a = list(map(int, input().split()))

print(max(abs(a[n-1] - w), abs(a[n-2] - a[n-1])))

Buggy submission (verdict: Runtime Error):
n, z, w = map(int, input().split())
a = list(map(int, input().split()))

print(max(abs(a[n-1] - w), abs(a[n-2] - a[n-1])
Problem p03860 (python)

Fixed submission:
list = input().split()
i = 0
while True:
	if i>2:
		break
	print(list[i][0:1],end='')
	i += 1

Buggy submission (verdict: Runtime Error):
list = input()
i = 0
while True:
	if i>3:
    	break
	print(list[0][0:1],end='')
    i += 1

Buggy submission (verdict: Runtime Error):
list = input().split()

i=0
while True:
  if i>2:
    break
  print(list[i][0:1])
  i++
Problem p03962 (python)

Fixed submission:
print(len(set(list(map(int, input().split())))))

Buggy submission (verdict: Runtime Error):
print(ren(set(list(map(int, input().split()))))