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

#list_aaa = []
#
#for i in range(M):
#    L,R = map(int,input().split())
#    aaa = set(range(L,R+1))
#    list_aaa.append(aaa)
#print(list_aaa)

#and_set = list_aaa[0]

for i in range(M):
    L,R = map(int,input().split())
    aaa = set(range(L,R+1))
    if i == 0:
        and_set = aaa
    else:
        and_set = and_set.intersection(aaa)


print(len(and_set))



Fixed submission:
N,M = map(int,input().split())

L_list = []
R_list = []

for i in range(M):
    L,R = map(int,input().split())
    L_list.append(L)
    R_list.append(R)
L_max = max(L_list)
R_min = min(R_list)

#print(range(L_max,R_min+1))
print(len(range(L_max,R_min+1)))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())

list_aaa = []

for i in range(M):
    L,R = map(int,input().split())
    aaa = set(range(L,R+1))
    list_aaa.append(aaa)
#print(list_aaa)

and_set = list_aaa[0]

for i in range(M-1):
    and_set = and_set.intersection(list_aaa[i+1])


print(len(and_set))



Fixed submission:
N,M = map(int,input().split())

L_list = []
R_list = []

for i in range(M):
    L,R = map(int,input().split())
    L_list.append(L)
    R_list.append(R)
L_max = max(L_list)
R_min = min(R_list)

#print(range(L_max,R_min+1))
print(len(range(L_max,R_min+1)))
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce

def gcd(*numbers):
    return reduce(gcd, numbers)

def gcd_list(numbers):
    return reduce(gcd, numbers)

N = int(input())
list_aaa = list(map(int,input().split()))

print(gcd_list(list_aaa))



Fixed submission:
from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N = int(input())
list_aaa = list(map(int,input().split()))

print(gcd_list(list_aaa))

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

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = int(input())
list_aaa = list(map(int,input().split()))

print(gcd_list(list_aaa))



Fixed submission:
from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N = int(input())
list_aaa = list(map(int,input().split()))

print(gcd_list(list_aaa))
Buggy python submission (verdict: Runtime Error):
N,M =map(int,input().split())
list_aaa = list(map(int,input().split()))

list_aaa = sorted(list_aaa)
list_aaa_range = []

for i in range(M-1):
    list_aaa_range.append(list_aaa[i+1]-list_aaa[i])

list_aaa_range = sorted(list_aaa_range)

for i in range(1,N):
    list_aaa_range.pop(-1)

print(sum(list_aaa_range))

Fixed submission:
N,M =map(int,input().split())
list_aaa = list(map(int,input().split()))

list_aaa = sorted(list_aaa)
list_aaa_range = []

for i in range(M-1):
    list_aaa_range.append(list_aaa[i+1]-list_aaa[i])

list_aaa_range = sorted(list_aaa_range)

for i in range(1,N):
    if not list_aaa_range :
        list_aaa_range.append(0)
    else:
        list_aaa_range.pop(-1)

print(sum(list_aaa_range))
Buggy python submission (verdict: Runtime Error):
N,T = map(int,input().split())
list_aaa = [list(map(int,input().split())) for i in range(N)]

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][1])

if min_aaa ==1001:
    print(TLE)
else:
    print(min_aaa)




Fixed submission:
N,T = map(int,input().split())
list_aaa = [list(map(int,input().split())) for i in range(N)]

min_aaa =1001

for i in range(N):
    if T>= list_aaa[i][1]:
        min_aaa = min(min_aaa,list_aaa[i][0])

if min_aaa ==1001:
    print("TLE")
else:
    print(min_aaa)
Buggy python submission (verdict: Runtime Error):
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])


Fixed submission:
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N > list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])

Buggy python submission (verdict: Runtime Error):
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
    exit()
else:
    print(list_aaa[cnt])


Fixed submission:
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N > list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])

Buggy python submission (verdict: Runtime Error):
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
    exit()
else:
    print(list_aaa[cnt])


Fixed submission:
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N > list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])
Buggy python submission (verdict: Runtime Error):
N=list(input())
a=[]
b=[]
#print(N)
#print(len(N))
for k in range(len(N)+1):
    if k%2>0:
        a.append(N[k])
    else:
        b.append(N[k])
if   a.count('L')==0 and b.count('R')==0:
    print('Yes')
else:
    print('No')


Fixed submission:
N=list(input())
a=[]
b=[]
#print(N)
#print(len(N))
for k in range(len(N)):
    if k%2>0:
        b.append(N[k])
    else:
        a.append(N[k])
if   a.count('L')==0 and b.count('R')==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x=int(input().split)
A=x[0]
B=x[1]
C=x[2]
if B+C-A>0:
    print(B+C-A)
else:
    print(0)


Fixed submission:
x=input().split()
A=int(x[0])
B=int(x[1])
C=int(x[2])
if B+C-A>0:
    print(B+C-A)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
from math import *
N = int(input())


for i in range(1, N+1):
    if(floor(i*1.08) == N):
        print(i)
	exit()

print(':(')


Fixed submission:
from math import *
N = int(input())

ans = 0
for i in range(1, N+1):
    if(floor(i*1.08) == N):
        ans = i

if ans == 0:
    print(":(")
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

N = int(input())
S = input()
mod = 10**9 + 7

left = 0
ret = 1
for i in range(len(S)):
    if S[i] == 'W':
        if left % 2 == 1:
            left += 1
        else:
            if left > 0:
                ret *= left
                left -= 1
            else:
                print(0)
                exit()
    else:
        if left % 2 == 1:
            ret *= left
            left -= 1
        else:
            left += 1

if left > 0:
    print(0)
    exit()
            
for i in range(1, N+1):
    ret *= i
    ret %= mod
print(ret)


Fixed submission:
import math

N = int(input())
S = input()
mod = 10**9 + 7

left = 0
ret = 1
for i in range(len(S)):
    if S[i] == 'W':
        if left % 2 == 1:
            left += 1
        else:
            if left > 0:
                ret *= left
                ret %= mod
                left -= 1
            else:
                print(0)
                exit()
    else:
        if left % 2 == 1:
            ret *= left
            ret %= mod
            left -= 1
        else:
            left += 1

if left > 0:
    print(0)
    exit()
            
for i in range(1, N+1):
    ret *= i
    ret %= mod
print(ret)

Buggy python submission (verdict: Runtime Error):
from functools import lru_cache

N = int(input())
S = input()
mod = 10 ** 9 + 7
x = 0
for i in range(len(S)):
    if S[i] == 'B':
        x += 2**i

@lru_cache(maxsize=10**10)
def func(now, remain=tuple(range(2*N))):
    if len(remain) == 0:
        if now == 0:
            return 1
        else:
            return 0
        
    ret = 0
    for i in range(len(remain)):
        for j in range(i+1, len(remain)):
            temp = list(remain)
            temp.pop(j)
            temp.pop(i)
            ret += func(now ^ ((2**(remain[j]+1)-1)-(2**remain[i]-1)), tuple(temp))
            ret %= mod
    return ret

print(func(x) % mod)


Fixed submission:
import math

N = int(input())
S = input()
mod = 10**9 + 7

left = 0
ret = 1
for i in range(len(S)):
    if S[i] == 'W':
        if left % 2 == 1:
            left += 1
        else:
            if left > 0:
                ret *= left
                ret %= mod
                left -= 1
            else:
                print(0)
                exit()
    else:
        if left % 2 == 1:
            ret *= left
            ret %= mod
            left -= 1
        else:
            left += 1

if left > 0:
    print(0)
    exit()
            
for i in range(1, N+1):
    ret *= i
    ret %= mod
print(ret)
Buggy python submission (verdict: Runtime Error):
N, M, P = map(int, input().split())
edge = []

for i in range(M):
    A, B, C = map(int, input().split())
    edge.append((A, B, P-C))

inf = float('inf')
cost = [inf] * (N+1)
cost[1] = 0
for i in range(N-1):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            cost[b] = cost[a] + c

for e in edge:
    a, b, c = e
    if cost[a] + c < cost[b]:
        if b == N:
      	    print(-1)
            exit()
        cost[b] = cost[a] + c
        
print(max(-cost[N], 0))





        


Fixed submission:
N, M, P = map(int, input().split())
edge = []

for i in range(M):
    A, B, C = map(int, input().split())
    edge.append((A, B, P-C))

inf = float('inf')
cost = [inf] * (N+1)
cost[1] = 0
for i in range(N-1):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            cost[b] = cost[a] + c

for i in range(N):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            if b == N:
                print(-1)
                exit()
            else:
                cost[b] = cost[a] + c
        
print(max(-cost[N], 0))

Buggy python submission (verdict: Runtime Error):
N, M, P = map(int, input().split())
edge = []

for i in range(M):
    A, B, C = map(int, input().split())
    edge.append((A, B, P-C))

inf = float('inf')
cost = [inf] * (N+1)
cost[1] = 0
for i in range(N-1):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            cost[b] = cost[a] + c

for e in edge:
    a, b, c = e
    if cost[a] + c < cost[b]:
      if b == N:
      	print(-1)
        exit()
      cost[b] = cost[a] + c
        
print(max(-cost[N], 0))





Fixed submission:
N, M, P = map(int, input().split())
edge = []

for i in range(M):
    A, B, C = map(int, input().split())
    edge.append((A, B, P-C))

inf = float('inf')
cost = [inf] * (N+1)
cost[1] = 0
for i in range(N-1):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            cost[b] = cost[a] + c

for i in range(N):
    for e in edge:
        a, b, c = e
        if cost[a] + c < cost[b]:
            if b == N:
                print(-1)
                exit()
            else:
                cost[b] = cost[a] + c
        
print(max(-cost[N], 0))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
XY = [[int(x) for x in input().split()] for i in range(N)]
mod = 998244353
XY.sort() #Xについてソート
X, Y = zip(*XY)
Y_rank = {x:i for i, x in enumerate(sorted(Y), 1)}
BIT = [0] * (N+1)

def append_BIT(x):
    while x <= N:
        BIT[x] += 1
        x += x & (-x)

def sum_BIT(x):
    ret = 0
    while x:
        ret += BIT[x]
        x &= (x-1)
    return ret

pow2 = [1]
for i in range(N):
    pow2.append(pow2[-1] * 2 % mod)

ret = 0 
for i in range(N):
    y = Y_rank[Y[i]]
    L = i
    R = N-i-1
    D = y-1
    U = N-D-1
    LD = sum_BIT(y)
    append_BIT(y)
    LU = L - LD
    RU = U - LU
    RD = D - LD
    
    ret += (pow2[N]-1 - pow2[L] - pow2[R] - pow2[U] - pow2[D] + pow2[LD] + pow2[LU] + pow2[RU] + pow2[RD])
    ret %= mod

print(ret)
    



Fixed submission:
N = int(input())
XY = [[int(x) for x in input().split()] for i in range(N)]
mod = 998244353
XY.sort() #Xについてソート
X, Y = zip(*XY)
Y_rank = {x:i for i, x in enumerate(sorted(Y), 1)}
BIT = [0] * (N+1)

def append_BIT(x):
    while x <= N:
        BIT[x] += 1
        x += x & (-x)

def sum_BIT(x):
    ret = 0
    while x:
        ret += BIT[x]
        x &= (x-1)
    return ret

pow2 = [1]
for i in range(N):
    pow2.append(pow2[-1] * 2 % mod)

ret = 0 
for i in range(N):
    y = Y_rank[Y[i]]
    L = i
    R = N-i-1
    D = y-1
    U = N-D-1
    LD = sum_BIT(y)
    append_BIT(y)
    LU = L - LD
    RU = U - LU
    RD = D - LD
    
    ret += (pow2[N]-1 - pow2[L] - pow2[R] - pow2[U] - pow2[D] + pow2[LD] + pow2[LU] + pow2[RU] + pow2[RD])
    
ret %= mod
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

def sort(l, a):
    for i in range(len(l)):
        if(l[i] < a):
            return l[:i] + [a] + l[i+1:]
        
right_list = [A[0]]
if(N == 1):
    print(1)
else:
    for i in range(1, N):
        if(A[i] > right_list[-1]):
            if(A[i] > right_list[0]):
                right_list.pop(0)
                right_list = [A[i]] + right_list 
            else:
                right_list = sort(right_list, A[i])
        else:
            right_list.append(A[i])

print(len(right_list))


Fixed submission:
from bisect import *

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

r = [10**10] * N
index = -1
for i in range(N):
    j = bisect_right(r, -A[i])
    r[j] = -A[i]
    if j > index:
        index = j
print(index + 1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

if(N == 1):
    print(1)
else:
    color = 1
    right = A[N-1]
    left_list = [-1]
    for i in range(1, N):
        num = N-i-1
        if(A[num] >= right):
            max_left = max(left_list)
            if(A[num] >= max_left):
                color += 1
                left_list.append(right)
            else:
                left_list.pop(left_list.index(max_left))
                left_list.append(A[num])
        right = A[num]
    print(color)


Fixed submission:
from bisect import *

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

r = [10**10] * N
index = -1
for i in range(N):
    j = bisect_right(r, -A[i])
    r[j] = -A[i]
    if j > index:
        index = j
print(index + 1)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
S = [0] + list(map(int, input().split()))
T = [0] + list(map(int, input().split()))
mod = 10**9 + 7

dp = [[0] * (M+1) for i in range(N+1)]
dp_sum = [[0] * (M+1) for i in range(N+1)]

for i in range(1, N+1):
    for j in range(1, M+1):
        if S[i] == T[j]:
            dp_sum[i][j] = dp_sum[i][j-1] + dp_sum[i-1][j] + 1
        else:
            dp_sum[i][j] = dp_sum[i][j-1] + dp_sum[i-1][j] - dp_sum[i-1][j-1]

print((dp_sum[N][M]+1) % mod)


Fixed submission:
from collections import defaultdict

N, M = map(int, input().split())
S = [0] + list(map(int, input().split()))
T = [0] + list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_dp = []
for i in range(N+1):
    sum_dp.append([0] * (M+1))

temp = 0
for i in range(1, N+1):
    for j in range(1, M+1):
        temp = 0
        if(S[i] == T[j]):
            temp = sum_dp[i-1][j-1] + 1
        sum_dp[i][j] = (sum_dp[i-1][j] + sum_dp[i][j-1] - sum_dp[i-1][j-1] + temp) % mod

print(sum_dp[N][M] + 1)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict

N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_dp = defaultdict(int)

for i in range(N):
    for j in range(M):
        temp = 0
        if(S[i] == T[j]):
            temp = sum_dp[(i-1, j-1)] + 1
        sum_dp[(i, j)] = sum_dp[(i-1, j)] + sum_dp[(i, j-1)] - sum_dp[(i-1, j-1)] + temp
        sum_dp[(i, j)] %= mod

print(sum_dp[(N-1, M-1)] + 1)


Fixed submission:
from collections import defaultdict

N, M = map(int, input().split())
S = [0] + list(map(int, input().split()))
T = [0] + list(map(int, input().split()))
mod = 10 ** 9 + 7
sum_dp = []
for i in range(N+1):
    sum_dp.append([0] * (M+1))

temp = 0
for i in range(1, N+1):
    for j in range(1, M+1):
        temp = 0
        if(S[i] == T[j]):
            temp = sum_dp[i-1][j-1] + 1
        sum_dp[i][j] = (sum_dp[i-1][j] + sum_dp[i][j-1] - sum_dp[i-1][j-1] + temp) % mod

print(sum_dp[N][M] + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()

def divisor(x, m):
    ret = []
    for i in range(1, int(x**0.5)+1):
        if i >= m:
            return ret
            
        if x % i == 0:
            ret.append(i)
            compl = x//i
            if i*i != x and compl < m:
                ret.append(compl)
    return ret

divisor_dict = {}
m = 10 ** 10
for i in range(len(A)):
    if i==3:
        m = 0
        for key, val in divisor_dict:
            if val >= 2 and key > m:
                m = key
    
    div = divisor(A[i], m)
    for j in div:
        if j in divisor_dict:
            divisor_dict[j] += 1
        else:
            divisor_dict[j] = 1
        
max_val = 0
for key, val in divisor_dict.items():
    if val >= N-1 and key > max_val:
        max_val = key

print(max_val)


Fixed submission:
N = int(input())
A = [0] + list(map(int, input().split()))

def gcd(a, b):
    if a < b:
        b, a = a, b
    if b == 0:
        return a
        
    while a % b != 0:
        a %= b
        a, b = b, a

    return b

L = [0] * (N+1)
R = [0] * (N+2)

for i in range(1, N+1):
    ind = N+1-i
    L[i] = gcd(L[i-1], A[i-1])
    R[ind] = gcd(R[ind+1], A[ind])

ret = []
for i in range(1, N+1):
    ret.append(gcd(L[i], R[i+1]))

print(max(ret))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

def divisor(x):
    ret = []
    for i in range(1, int(x**0.5)+1):
        if x % i == 0:
            ret.append(i)
            if i*i != x:
                ret.append(x//i)
    return ret

divisor_dict = {}
for i in range(len(A)):
    div = divisor(A[i])
    for j in div:
        if j in divisor_dict:
            divisor_dict[j] += 1
        else:
            divisor_dict[j] = 1

max_val = 0
for key, val in divisor_dict.items():
    if val >= N-1 and key > max_val:
        max_val = key

print(max_val)


Fixed submission:
N = int(input())
A = [0] + list(map(int, input().split()))

def gcd(a, b):
    if a < b:
        b, a = a, b
    if b == 0:
        return a
        
    while a % b != 0:
        a %= b
        a, b = b, a

    return b

L = [0] * (N+1)
R = [0] * (N+2)

for i in range(1, N+1):
    ind = N+1-i
    L[i] = gcd(L[i-1], A[i-1])
    R[ind] = gcd(R[ind+1], A[ind])

ret = []
for i in range(1, N+1):
    ret.append(gcd(L[i], R[i+1]))

print(max(ret))
Buggy python submission (verdict: Runtime Error):
from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
cand = []

for i in range(len(A)):
    for j in range(len(B)):
        if(i + j + 1 >= K):
            break
        for k in range(len(C)):
            if(i + j + k + 1 >= K):
                break
            heappush(cand, A[i]+B[j]+C[k])
            if(len(cand) > K):
                heappop(cand)

ret = []
for i in range(K):
    ret.append(heappop(cand))

for i in reversed(range(K)):
    print(ret[i])
    


Fixed submission:
from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
cand = []

for i in range(len(A)):
    for j in range(len(B)):
        if(i * j > K):
            break
        for k in range(len(C)):
            if(i *  j * k > K):
                break
            heappush(cand, A[i]+B[j]+C[k])
            if(len(cand) > K):
                heappop(cand)

ret = []
for i in range(K):
    ret.append(heappop(cand))

for i in reversed(range(K)):
    print(ret[i])

Buggy python submission (verdict: Runtime Error):
from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
cand = []

for i in range(len(A)):
    for j in range(len(B)):
        if(i + j + 1 >= K):
            break
        for k in range(len(C)):
            if(i + j + k + 1 >= K):
                break
            heappush(cand, -(A[i]+B[j]+C[k]))

for i in range(K):
    print(-heappop(cand))
    


Fixed submission:
from heapq import heappush, heappop

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
cand = []

for i in range(len(A)):
    for j in range(len(B)):
        if(i * j > K):
            break
        for k in range(len(C)):
            if(i *  j * k > K):
                break
            heappush(cand, A[i]+B[j]+C[k])
            if(len(cand) > K):
                heappop(cand)

ret = []
for i in range(K):
    ret.append(heappop(cand))

for i in reversed(range(K)):
    print(ret[i])
Buggy python submission (verdict: Runtime Error):
import math
n, d = map(int, input().split)
print(math.ceil(n/(2*d+1)))

Fixed submission:
import math
n, d = map(int, input().split())
print(math.ceil(n/(2*d+1)))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
n = input()
list = n.split(" ")
num = [int(x) for x in list ]

print(num.max - num.min)
    

Fixed submission:
# coding: utf-8
n = input()
list = n.split(" ")
num = [int(x) for x in list ]

print(max(num)-min(num))
Buggy python submission (verdict: Runtime Error):
s = input()
weeks_dict = ["MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6,"SUN":7]
if(s=="SUN"):
    print(7)
else:
    print(7 - weeks_dict[s])


Fixed submission:
s = input()
weeks_dict = {"MON":1,"TUE":2,"WED":3,"THU":4,"FRI":5,"SAT":6,"SUN":7}
if(s=="SUN"):
    print(7)
else:
    print(7 - weeks_dict[s])
Buggy python submission (verdict: Runtime Error):
n = [int(x) for x in input()]

op_cnt = len(n) - 1  # すき間の個数
for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt  # あらかじめ ["-", "-", "-"] というリストを作っておく
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"  # フラグが立っていた箇所を "+" で上書き
        formula = ""
        for p_n, p_o in zip(n, op + [""]):  # 少々モヤッとする
            formula += (p_n + p_o)
        if eval(formula) == 7:
            print(formula + "=7")
            break

Fixed submission:
n = input()
op_cnt = len(n) - 1  # すき間の個数
for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt  # あらかじめ ["-", "-", "-"] というリストを作っておく
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"  # フラグが立っていた箇所を "+" で上書き

    formula = ""
    for p_n, p_o in zip(n, op + [""]):  # 少々モヤッとする
        formula += (p_n + p_o)
    if eval(formula) == 7:
        print(formula + "=7")
        break
Buggy python submission (verdict: Time Limit Exceeded):
x,y,z = map(int, input().split())

cnt = 0
for i in range(x,y+1):
    if(i % z==0):
        cnt = cnt +1
print(cnt)


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