Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))

S1 = min(l1[0] * li[3], l1[0] * (li[1] - li[3]))
S2 = min(li[2] * li[1], (li[0] - li[2]) * li[1])

if S1 == S2:
    print(S1, 1)
else:
    print(min(S1, S2), 0)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    s = list(map(int,input().split()))

    if (s[0] / 2.0 == s[2]) and (s[1] / 2.0 == s[3]):
        print(s[0] * s[1] / 2.0, 1)
    else:
        print(s[0] * s[1] / 2.0, 0)

if __name__ == '__main__':
    main()

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

S1 = min(l1[0] * li[2], l1[0] * (li[1] - li[2]))
S2 = min(li[1] * li[3], li[1] * (li[0] - li[3]))

if S1 == S2:
    print(S1, 1)
else:
    print(min(S1, S2), 0)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    s = list(map(int,input().split()))

    if (s[0] / 2.0 == s[2]) and (s[1] / 2.0 == s[3]):
        print(s[0] * s[1] / 2.0, 1)
    else:
        print(s[0] * s[1] / 2.0, 0)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a = input()
if (a[0]==a[1]) or (a[1]==a[2]) or (a[2]==a[3]):
  print("Bad")
else :
  print(Good)

Fixed submission:
a = input()
if (a[0]==a[1]) or (a[1]==a[2]) or (a[2]==a[3]):
  print("Bad")
else :
  print("Good")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
  x,y = input().split()
  a.append([x,-int(y),i+1])
a.sort()
for i in range(n):
  print(a[i][2])

Fixed submission:
A,N = map(int,input().split())
print((3*A+N)//2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
  x,y = input().split()
  a.append([x,-int(y),i+1])
a.sort()
for i in range(n):
  print(a[i][2])



Fixed submission:
A,N = map(int,input().split())
print((3*A+N)//2)
Buggy python submission (verdict: Runtime Error):
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 0<b<=12 & 0<c<=12:
    print('AMBIGUOUS')
elif 0<b<=12 & (c>12 or C ==0) :
    print('MMYY') 
elif (b>12 or b==0) & 0<c<=12:
    print('YYMM')
else:
    print('NA')

Fixed submission:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 and 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=12:
    print('YYMM')
else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = int(input())
d = b[c]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)

Fixed submission:
a = int(input())
b = input()
c = int(input())
d = b[c-1]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)
Buggy python submission (verdict: Runtime Error):
H=input(), W=input()
H=int(H),W=int(W)
h=input(),w=input() 
h=int(h),w=int()
print((H-h)*(W-w))

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
H=input()
H=int(H)
h=input()
h=int(h)
W=input()
W=int(W)
w=input()
w=int(w)
print((H-h)*(W-w))

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
H=input()
h=input()
W=input()
w=input()
x=(int(H)-int(h))*(int(W)-int(w))
ptint(x)

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
H=input()
h=input()
W=input()
w=input()
x=(int(H)-int(h))*(int(W)-int(w))

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
x=(W-w)*(H-h)

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))

Buggy python submission (verdict: Runtime Error):
x=(H-h-)*(W-w)

Fixed submission:
H,W=map(int,input().split())#標準入力を行う
h,w=map(int,input().split())#標準入力を行う
print((H-h)*(W-w))
Buggy python submission (verdict: Runtime Error):
A,B,C = input().split()
if A*B*C/145==1:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,C = map(int, input().split())
if A*B*C/175==1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import sys
N = int(input())

if len(N) <= 1:
    print('Good')
    sys.exit()

for i in range(1, len(N)):
    if N[i] == N[i-1]:
        print('Bad')
        sys.exit()

print('Good')

Fixed submission:
import sys
N = input()

if len(N) <= 1:
    print('Good')
    sys.exit()

for i in range(1, len(N)):
    if N[i] == N[i-1]:
        print('Bad')
        sys.exit()

print('Good')
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
print("even" if a * b % 2 == 0 else "odd")

Fixed submission:
a, b = map(int, (input().split()))
print("Even" if a * b % 2 == 0 else "Odd")
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())

for a in range(N):
    for b in range(N - a):
        c = N - a - b
        if 0 <= c <= 2000 & 10000 * a + 5000 * b + 1000 * c == Y:
            print(a,b,c)
            exit()

print(-1, -1, -1)

Fixed submission:
N = int(input())
D = [input() for _ in range(N)]

print(len(set(D)))
Buggy python submission (verdict: Time Limit Exceeded):
input()

A = list(map(int, input().split()))
ans = 0

while all(a % 2 == 0 for a in A):
    A = [a % 2 for a in A]
    ans += 1

print(ans)

Fixed submission:
input()

A = list(map(int, input().split()))
ans = 0

while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split())
L = [int(i) for i in input().split()]
gap=[]
time=T

for i in range(N-1)
	gap.append(L[i+1]-L[i])

for i in range(N-1):
	time += min(B[i],T)

print(time)

Fixed submission:
N, T = map(int, input().split())
L = [int(i) for i in input().split()]
gap=[]
time=T

for i in range(N-1):
	gap.append(L[i+1]-L[i])

for i in range(N-1):
	time += min(gap[i],T)

print(time)
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l1='BPPPB'
for i in range(n-1):
    l2 = 'B'+l1+'P'+l1+'B'
    l1 = l2
y = l1[:x].count('P')
print(y)

Fixed submission:
d = int(input())
if d==25:
    print('Christmas')
elif d== 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
elif d == 22:
    print('Christmas Eve Eve Eve')

Buggy python submission (verdict: Runtime Error):
d = int(input())
if d=25:
    print('Christmas')
elif d= 24:
    print('Christmas Eve')
elif d = 23:
    print('Christmas Eve Eve')
elif d = 22:
    print('Christmas Eve Eve Eve')

Fixed submission:
d = int(input())
if d==25:
    print('Christmas')
elif d== 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
elif d == 22:
    print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
N,K = [int(i) for i in input().split()] 
bi=None
if 2<=1-L and 1-L<=N:
    bi =1-L
elif 1-L>=N:
    bi = N
elif 2>=1-L:
    bi =1
ajis = [L+i for i in range (N)]
org_sum = sum(ajis)
ans = org_sum -(L+bi-1)
print(ans)

Fixed submission:
N,L = [int(i) for i in input().split()] 
bi=None
if 2<=1-L and 1-L<=N:
    bi =1-L
elif 1-L>=N:
    bi = N
elif 2>=1-L:
    bi =1
ajis = [L+i for i in range (N)]
org_sum = sum(ajis)
ans = org_sum -(L+bi-1)
print(ans)
Buggy python submission (verdict: Runtime Error):
180*N-360

Fixed submission:
N=int(input())
print(180*N-360)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

ans = 0
for i in range(n-2):
    if s[i]+s[i+1] == "#.":
        if s[i+2] == "#":
            s.replace(s[i+1],"#")
            ans += 1
        if s[i+2] == ".":
            s.replace(s[i+1],".")
            ans += 1
if s[-2]+s[-1] == "#.":
    s.replace(s[i+1],"#")
    ans += 1
print(ans)

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

if a<c<b or a>c>b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = input()

if len(s) == 2:
    print(s)
else:
    print(s[::-1])

Fixed submission:
s = str(input())

if len(s) == 2:
    print(s)
else:
    print(s[::-1])
Buggy python submission (verdict: Runtime Error):
import math 

n = int(input())

print(2*n//math.gcd(2,n))

Fixed submission:
n = int(input())

if n%2 == 0:
    print(n)
else:
    print(n*2)

Buggy python submission (verdict: Runtime Error):
from math import gcd

n = int(input())

print(2*n//gcd(2,n))

Fixed submission:
n = int(input())

if n%2 == 0:
    print(n)
else:
    print(n*2)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D ;
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))

Fixed submission:
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D:
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))

Buggy python submission (verdict: Runtime Error):
import numpy as np
 
A,B,C,D = map(int,input().split())
lcm = int(C * D/ np.gcd(C,D))
A = A-1
A_n = A - (A//C + A//D - A//lcm)
B_n = B - (B//C + B//D - B//lcm)
print(int(B_n-A_n))

Fixed submission:
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D:
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))

Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D = map(int,input().split())
lcm = int(C * D/ math.gcd(C,D))
A = A-1
A_n = A - (A//C + A//D - A//lcm)
B_n = B - (B//C + B//D - B//lcm)
print(int(B_n-A_n))

Fixed submission:
def gcd(a,b):
    while b != 0:
        temp = b
        b = a%b
        a = temp
    return a
A,B,C,D = map(int,input().split())
if C >=D:
    lc = int(C*D/gcd(C,D))
else: lc = int(C*D/gcd(D,C))
A = A-1
A_n = A - (A//C + A//D - A//lc)
B_n = B - (B//C + B//D - B//lc)
print(int(B_n-A_n))
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
list_and = list(range(1,N+1,1))
for i in range(M):
    L, R = list(map(int, input().split()))
    list_temp = list(range(L,R+1,1))
    list_and = list(set(list_and) & set(list_temp))
print(len(list_and))

Fixed submission:
a,b = map(int,input().split())
if a >= 13:
    print(b)
elif a>=6 and a<=12:
    print(round(b/2))
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
list_append = list(range(1,N+1,1))
for i in range(M):
    L, R = list(map(int, input().split()))
    list_append += list(range(L,R+1,1))
    list_append = [x for x in set(list_append) if list_append.count(x) > 1]
print(len(list_append))

Fixed submission:
n, m = map(int, input().split())
l = 0
r = n
for _ in range(m):
    nl, nr = map(int, input().split())
    l = max(nl, l)
    r = min(nr, r)
 
print(max(r - l + 1, 0))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
list_and = list(range(1,N+1,1))
for i in range(M):
    L, R = list(map(int, input().split()))
    list_temp = list(range(L,R+1,1))
    list_and = list(set(list_and) & set(list_temp))
print(len(list_and))

Fixed submission:
n, m = map(int, input().split())
l = 0
r = n
for _ in range(m):
    nl, nr = map(int, input().split())
    l = max(nl, l)
    r = min(nr, r)
 
print(max(r - l + 1, 0))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
list_and = list(range(1,N+1,1))
for i in range(M):
    L, R = list(map(int, input().split()))
    list_temp = list(range(L,R+1,1))
    list_and = set(list_and) & set(list_temp)
print(len(list_and))

Fixed submission:
n, m = map(int, input().split())
l = 0
r = n
for _ in range(m):
    nl, nr = map(int, input().split())
    l = max(nl, l)
    r = min(nr, r)
 
print(max(r - l + 1, 0))
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())

import sympy as sym
list_A = sym.divisors(A)
list_B = sym.divisors(B)

list_and = set(list_A) & set(list_B)

list_and_sort = sorted(list_and, reverse=True)

print(list_and_sort[K-1])

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

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

list_A = make_divisor_list(A)
list_B = make_divisor_list(B)

list_and = set(list_A) & set(list_B)

list_and_sort = sorted(list_and, reverse=True)

print(list_and_sort[K-1])
Buggy python submission (verdict: Runtime Error):
from math import gcd
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
kyori_list = [abs(X-i) for i in x_list]
ans_gcd = kyori_list[0]
for i in kyori_list[1:]:
    ans_gcd = gcd(ans_gcd, i)
print(ans_gcd)

Fixed submission:
from fractions import gcd
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
kyori_list = [abs(X-i) for i in x_list]
ans_gcd = kyori_list[0]
for i in kyori_list[1:]:
    ans_gcd = gcd(ans_gcd, i)
print(ans_gcd)

Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())

from math import gcd

N, X = map(int, input().split())
x_list = list(map(int, input().split()))

kyori_list = [abs(X-i) for i in x_list]

ans_gcd = kyori_list[0]
for i in kyori_list[1:]:
    ans_gcd = gcd(ans_gcd, i)
print(ans_gcd)

Fixed submission:
from fractions import gcd
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
kyori_list = [abs(X-i) for i in x_list]
ans_gcd = kyori_list[0]
for i in kyori_list[1:]:
    ans_gcd = gcd(ans_gcd, i)
print(ans_gcd)

Buggy python submission (verdict: Runtime Error):
from math import gcd
N, X = map(int, input().split())
x = [abs(X - i) for i in map(int, input().split())]
d = x[0]
for X in x[1:]:
    d = gcd(d,X)
print(d)

Fixed submission:
from fractions import gcd
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
kyori_list = [abs(X-i) for i in x_list]
ans_gcd = kyori_list[0]
for i in kyori_list[1:]:
    ans_gcd = gcd(ans_gcd, i)
print(ans_gcd)
Buggy python submission (verdict: Time Limit Exceeded):
val = list(map(int, input().strip().split()))
n = val[0]
m = val[1]
a = []

for i in range(m):
    a.append(int(input().strip()))

pastpast_result = 0
past_result = 1
result = 0

for i in range(n):
    result = 0
    if i not in a:
        result += past_result
    if i-1 not in a:
        result += pastpast_result

    if result > 1000000007:
        result = result % 1000000007
    
    pastpast_result = past_result
    past_result = result

print(result % 1000000007)

Fixed submission:
import bisect

def find_bisect(a, x):
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return True
    return False

val = list(map(int, input().strip().split()))
n = val[0]
m = val[1]
a = []

for i in range(m):
    a.append(int(input().strip()))

pastpast_result = 0
past_result = 1
result = 0

for i in range(n):
    result = 0
    if not find_bisect(a, i):
        result += past_result
    if not find_bisect(a, i-1):
        result += pastpast_result

    if result > 1000000007:
        result = result % 1000000007
    
    if result == 0:
        break
    
    pastpast_result = past_result
    past_result = result

print(result % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
val = list(map(int, input().strip().split()))
n = val[0]
m = val[1]
a = []

for i in range(m):
    a.append(int(input().strip()))

pastpast_result = 0
past_result = 1
result = 0

for i in range(n):
    result = 0
    if i not in a:
        result += past_result
    if i-1 not in a:
        result += pastpast_result
    
    pastpast_result = past_result
    past_result = result

print(result % 1000000007)

Fixed submission:
import bisect

def find_bisect(a, x):
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return True
    return False

val = list(map(int, input().strip().split()))
n = val[0]
m = val[1]
a = []

for i in range(m):
    a.append(int(input().strip()))

pastpast_result = 0
past_result = 1
result = 0

for i in range(n):
    result = 0
    if not find_bisect(a, i):
        result += past_result
    if not find_bisect(a, i-1):
        result += pastpast_result

    if result > 1000000007:
        result = result % 1000000007
    
    if result == 0:
        break
    
    pastpast_result = past_result
    past_result = result

print(result % 1000000007)
Buggy python submission (verdict: Runtime Error):
import sys

w, h, x, y = input().split()
w = float(w)
h = float(h)
x = float(x)
y = float(y)
s=0

for i in range(100000000):
  a=i/1000
  if a<=h/w:
    cand=w*(a*w-2*a*x+2*y)/2
    s_cand=min(cand,w*h-cand)
    if s_cand>s:
      s=s_cand
  else:
    cand=h*(h+2*a*x-2*y)/(2*a)
    s_cand=min(cand,w*h-cand)
    if s_cand>s:
      s=s_cand
      
if w/2==x and h/2==y:
  print(w*h/2, 1)
else:
  print(s,0)

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

if x < a:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
n, x = input().split()
n = int(n)
x = int(x)
l = input().split()
a = 0

for i in range(n):
  a += int(l[i])
  if a > x:
    j = i
    break
    
print(j + 1)

Fixed submission:
import sys

n, x = input().split()
n = int(n)
x = int(x)
l = input().split()
a = 0

for i in range(n):
  a += int(l[i])
  if a > x:
    print(i+1)
    sys.exit()
    
print(n+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
  a.append(input().split())
  a[i][0] = int(a[i][0])
  a[i][1] = int(a[i][1])
b = []
d = []
e = []
a.sort()
dic = {}
for i in range(n-1):
  if [a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]] not in d:
    d.append([a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]])
    e.append(1)
  else:
    e[d.index([a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]])] += 1
# f = d[e.index(max(e))]
# p = f[0]
# q = f[1]
print(n-max(e))

Fixed submission:
n, k = input().split()
n = int(n)
k = int(k)

if k == 1:
  print(0)
else:
  print(n-k)
Buggy python submission (verdict: Runtime Error):
a = input().split()
b = input()

list = list(b)

for i in list:
  if i == a[1] - 1:
    list[i] = list[i].lower()
    
print(''.join(list))

Fixed submission:
a = input().split()
b = input()
 
c = list(b)
 
for i in range(len(c)):
  if i == int(a[1]) - 1:
    c[i] = c[i].lower()
    
print(''.join(c))
Buggy python submission (verdict: Runtime Error):
import numpy as np
a = input()
n, l = [int(i) for i in a.split(" ")]
apples = np.array([i for i in range(n)])
aji = apples + l
abss = [np.abs(aji[apples != i].sum() - aji.sum()) for i in range(n)]
i = abss.index(np.min(abss))
print([aji[apples != i].sum()][i])

Fixed submission:
import numpy as np
a = input()
n, l = [int(i) for i in a.split(" ")]
apples = np.array([i for i in range(n)])
aji = apples + l
abss = [np.abs(aji[apples != i].sum() - aji.sum()) for i in range(n)]
i = abss.index(np.min(abss))
print(aji[apples != i].sum())

Buggy python submission (verdict: Runtime Error):
import numpy as np
a = input()
int(n), int(l) = a.split(" ")
apples = [i for i in range(n)]
abs_app = np.abs(apples)
m = abs_app.min()
app = np.array(apples)
app = app + l - 1
print(app[abs_app != m].sum())


Fixed submission:
import numpy as np
a = input()
n, l = [int(i) for i in a.split(" ")]
apples = np.array([i for i in range(n)])
aji = apples + l
abss = [np.abs(aji[apples != i].sum() - aji.sum()) for i in range(n)]
i = abss.index(np.min(abss))
print(aji[apples != i].sum())

Buggy python submission (verdict: Runtime Error):
import numpy as np
a = input()
n, l= a.split(" ")
apples = [i for i in range(n)]
abs_app = np.abs(apples)
m = abs_app.min()
print((np.array(apples)[abs_app == m]).sum())


Fixed submission:
import numpy as np
a = input()
n, l = [int(i) for i in a.split(" ")]
apples = np.array([i for i in range(n)])
aji = apples + l
abss = [np.abs(aji[apples != i].sum() - aji.sum()) for i in range(n)]
i = abss.index(np.min(abss))
print(aji[apples != i].sum())
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

def lcm(x, y):
	return (x * y) // math.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Fixed submission:
import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
def lcm(x, y):
	return (x * y) // math.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - (a // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Fixed submission:
import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import concurrent.futures as confu

def cou(i):
		if i % c != 0:
			if i % d != 0:
				return 1
		return 0
		
		
a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
count = 0
with confu.ProcessPoolExecutor() as ex:
	th = ex.map(cou, range(a,b))
	for i in th:
		count += i
print(count)

Fixed submission:
import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Buggy python submission (verdict: Runtime Error):
import numpy as np
import concurrent.futures as confu

def cou(i):
		if i % c != 0:
			if i % d != 0:
				return 1
		return 0
		
		
a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
count = 0
with confu.ThreadPoolExecutor() as ex:
	th = ex.map(cou, range(a,b))
	for i in th:
		count += i
print(count)

Fixed submission:
import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))

Buggy python submission (verdict: Runtime Error):
import numpy as np
a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
num = np.arange(a, b)
print((num % (c * d) == 0).sum())

Fixed submission:
import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

a = input()
a, b, c, d = [int(i) for i in a.split(" ")]
dc = (b // c) - ((a-1) // c)
dd = (b // d) - ((a-1)  // d)
dcd = (b // lcm(c, d)) - ((a-1) // lcm(c, d))
print((b - a) + 1 - (dc + dd - dcd))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import itertools

def main():
    X = int(raw_input())
    jumpTime = [ i for i in xrange(1,X+1) ]
    candidate = []
    for i in xrange(1, len(jumpTime)+1):
       candidate.append(list(itertools.combinations(jumpTime, i)))
    correct = []
    for can in candidate:
        for c in can:
            if sum(c) == X:
                correct.append(c)
    correctMax = map(max, correct)
    print min(correctMax)
        

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-

def main():
    X = int(raw_input())
    step = 0
    for i in xrange(1,X+1):
        step += i
        if step >= X:
            break
    print i

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A=raw_input()
B=raw_input()
C=raw_input()

D=A[0]+B[1]+C[2]

print(D)

Fixed submission:
A=raw_input()
B=raw_input()
C=raw_input()

D=A[0]+B[1]+C[2]

print(D)