Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from sys import exit, stderr, stdin, setrecursionlimit
input = stdin.readline
setrecursionlimit(10**7)
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return




MOD = 10**9+7
NUM = 10**5 + 2

fact = [1] * (NUM + 1)
fact_inv = [1] * (NUM + 1)

for i in range(1, NUM+1):
    fact[i] = (fact[i-1]*i) % MOD
# フェルマーの少定理から(a**MOD-1)が1 => (a**MOD-2)がaの逆元
fact_inv[NUM] = pow(fact[NUM], MOD-2, MOD)

# 階乗の逆元は、逆元の階乗なので、(n-1)!の逆元を求めたいなら(n!の逆元)*nでOK
for i in range(NUM, 2, -1):
    fact_inv[i-1] = (fact_inv[i]*i) % MOD

def perm(n,k):
    if n<k or k<0:
        return 0
    else:
        return (fact[n]*fact_inv[n-k])% MOD



def main():
    N, K = map(int,input().split())

    adjl = [[] for _ in range(N)]
    for _ in range(N-1):
        a ,b = map(int,input().split())
        a ,b = a-1, b-1
        adjl[a].append(b)
        adjl[b].append(a)
    deg = [len(n) for n in adjl]

    def count(n, parent = None):
        # ルートなら親を含めたその子の塗り方
        if parent is None:
            c = perm(K,deg[n]+1)
        # それ以外なら自分と親が決まってるので子の塗り方
        else:
            c = perm(K-2,deg[n]-1)
        for neigh in adjl[n]:
            if neigh == parent:
                continue
            c *= count(neigh,n)
            c %= MOD
        return c
    print(count(0))





if __name__ == "__main__":
    main()


Fixed submission:
from sys import exit, stderr, stdin, setrecursionlimit
input = stdin.readline
setrecursionlimit(10**7)
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return




MOD = 10**9+7
NUM = 10**5 + 2

fact = [1] * (NUM + 1)
fact_inv = [1] * (NUM + 1)

for i in range(1, NUM+1):
    fact[i] = (fact[i-1]*i) % MOD
# フェルマーの少定理から(a**MOD-1)が1 => (a**MOD-2)がaの逆元
fact_inv[NUM] = pow(fact[NUM], MOD-2, MOD)

# 階乗の逆元は、逆元の階乗なので、(n-1)!の逆元を求めたいなら(n!の逆元)*nでOK
for i in range(NUM, 2, -1):
    fact_inv[i-1] = (fact_inv[i]*i) % MOD

def perm(n,k):
    if n<k or k<0:
        return 0
    else:
        return (fact[n]*fact_inv[n-k])% MOD



def main():
    N, K = map(int,input().split())

    adjl = [[] for _ in range(N)]
    for _ in range(N-1):
        a ,b = map(int,input().split())
        a ,b = a-1, b-1
        adjl[a].append(b)
        adjl[b].append(a)
    deg = [len(n) for n in adjl]

    def count(n, parent = None):
        # ルートなら親を含めたその子の塗り方
        if parent is None:
            c = perm(K,deg[n]+1)
        # それ以外なら自分と親が決まってるので子の塗り方
        else:
            c = perm(K-2,deg[n]-1)
        for neigh in adjl[n]:
            if neigh == parent:
                continue
            c *= count(neigh,n)
            c %= MOD
        return c
    print(count(0))





if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
if kakeru > minus:
    grater=kakeru
else:
    grater=minus

if grater > plus:
    max=grater
else:
    max=plus

print(max)

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

kakeru=a*b
minus=a-b
plus=a+b


if kakeru > minus:
    grater=kakeru
else:
    grater=minus

if grater > plus:
    max=grater
else:
    max=plus

print(max)
Buggy python submission (verdict: Runtime Error):
if(modR <= modL):
    modMin = 0
else:
    modMin = 2018

for i in range(modL,modR):
    for j in range(i+1,modR+1):
        modIJ = (i*j)%2019
        # print(i)
        # print(j)
        # print('----')
        #print(modMin)
        #print(modIJ)
        #print('---')
        if modIJ < modMin:
            modMin = modIJ
print(modMin)

Fixed submission:
l,r = map(int, input().split())
waruL = l // 2019
waruR = r // 2019
if waruL < waruR :
    modMin = 0
else:
    modMin = 2018
    modL = l%2019
    modR = r%2019

    for i in range(modL,modR):
        for j in range(i+1,modR+1):
            modIJ = (i*j)%2019

            if modIJ < modMin:
                modMin = modIJ
print(modMin)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
aList=list(map(int,input().split()))
rList=[]
for i in range(n):
	r = 0
	for j in range(n):
		k = (i+j)%n
		if j%2 == 0:
			#print('plus')
			r += aList[k]
			#print(aList[k])
		else:
			#print('minus')
			r -= aList[k]
			#print(aList[k])
	rList.append(r)

print(' '.join(map(str, rList)))
	


Fixed submission:
n=int(input())
aList=list(map(int,input().split()))
rList = []
r1 = 0
for i in range(n):
	if i%2 == 0:
		r1 += aList[i]
	else:
		r1 -= aList[i]
rList.append(r1)

for i in range(n-1):
	r = (2 * aList[i]) - rList[i]
	rList.append(r)

print(' '.join(map(str, rList)))

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

for i in range(n):
	r = 0
	for j in range(n):
		k = (i+j)%n
		if j%2 == 0:
			#print('plus')
			r += aList[k]
			#print(aList[k])
		else:
			#print('minus')
			r -= aList[k]
			#print(aList[k])
	print(str(r) ,end=' ')
			
	


Fixed submission:
n=int(input())
aList=list(map(int,input().split()))
rList = []
r1 = 0
for i in range(n):
	if i%2 == 0:
		r1 += aList[i]
	else:
		r1 -= aList[i]
rList.append(r1)

for i in range(n-1):
	r = (2 * aList[i]) - rList[i]
	rList.append(r)

print(' '.join(map(str, rList)))
Buggy python submission (verdict: Runtime Error):
import math

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//math.gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

Fixed submission:
from fractions import gcd

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

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

def calcAns(n,x,y):
    print(math.gcd(x,y))
    return n - ((n//x) + (n//y) - (n//((x*y)//math.gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)

Fixed submission:
from fractions import gcd

def calcAns(n,x,y):
    return n - ((n//x) + (n//y) - (n//((x*y)//gcd(x,y))))

a,b,c,d = map(int, input().split())
ansB = calcAns(b,c,d)
ansA = calcAns(a-1,c,d)
print(ansB-ansA)
Buggy python submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split(' '))

c = math.fabs(a)
d = math.fabs(b)
f = (c + b) % 2

if f = 0:
  print((c+b)/2)
if f >0:
  print('IMPOSSIBLE')

Fixed submission:
import math
a, b = (int(x) for x in input().split(' '))

a = abs(a)
b = abs(b)

c = a + b

if c % 2 == 0:
    print(int(c / 2))
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [*map(int, input().split())]
b = [*map(int, input().split())]
res = 0
for i in range(n):
    res += min(a[i], b[i])
    b[i] = max(0, b[i] - a[i])
    res += min(b[i], a[i + 1])
    a[i + 1] = max(0, a[i + 1] - b[i])
print(res)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    res += min(a[i], b[i])
    b[i] = max(0, b[i] - a[i])
    res += min(b[i], a[i + 1])
    a[i + 1] = max(0, a[i + 1] - b[i])
print(res)
Buggy python submission (verdict: Runtime Error):
a, p = [*map(int, input().split())]
print('{}'.format((a * 3 + p) // 2))

Fixed submission:
a, p = list(map(int, input().split()))
print('{}'.format((a * 3 + p) // 2))

Buggy python submission (verdict: Runtime Error):
a, p = [*map(int, input().split())]
print((a * 3 + p) // 2)

Fixed submission:
a, p = list(map(int, input().split()))
print('{}'.format((a * 3 + p) // 2))
Buggy python submission (verdict: Runtime Error):
import sys

s = sys.stdin.gets()
t = sys.stdin.gets()

c = 0
for i in range(3):
  if s[i] == t[i]:
    c += 1
    
print(c)

Fixed submission:
import sys

s = sys.stdin.readline()
t = sys.stdin.readline()

c = 0
for i in range(3):
  if s[i] == t[i]:
    c += 1
    
print(c)

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
list = []
for i in range(N - 1):
    if H[i] < H[i + 1]:
        list.append('A')
    else:
        list.append('B')
W = ''.join(list)
Wlist = W.split('A')
anslist =[]
for i in range(len(Wlist)):
    anslist.append(len(Wlist[i]))
print(max(anslist))

Fixed submission:
S = list(input())
T = list(input())
count = 0
for i in range(len(S)):
    if S[i] == T[i]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]
A = []
cnt = 0
for k in S:
   A.append(''.join(sorted(k)))
for i in A[:]:
    cnt += A.count(i) - 1
    A.remove(i)
print(cnt)

Fixed submission:
A, B = map(int, input().split())
print(max([A + B, A - B, A * B]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for _ in range(N)]
A = []
cnt = 0
for k in S:
   B = sorted(k)
   C = ''.join(B)
   A.append(C)
for i in range(N):
    for j in range(N):
        if i >= j:
            continue
        elif A[i] == A[j]:
            cnt += 1
print(cnt)

Fixed submission:
A, B = map(int, input().split())
print(max([A + B, A - B, A * B]))
Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
if M == 1:
    print(0)
    sys.exit()
for i in range(M - 1):
    dif = X[i + 1] - X[i]
    A.append(dif)
for i in range(N - 1):
    A.remove(max(A))
print(sum(A))

Fixed submission:
T, X = map(int,input().split())
print(T / X)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N, M = map(int, input().split())
X = [int(_) for _ in input().split()]
X.sort()
A = []
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    for i in range(N - 1):
        A.remove(max(A))
sum = sum(A)
print(sum)

Fixed submission:
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
sum = 0
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    A = sorted(A, reverse = True)
    for k in A[N - 1:]:
        sum += k
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
N, M = map(int, input().split())
X = list(map(int,input().split()))
X.sort()
A = []
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    for i in range(N - 1):
        A.remove(max(A))
sum = sum(A)
print(sum)

Fixed submission:
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
sum = 0
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    A = sorted(A, reverse = True)
    for k in A[N - 1:]:
        sum += k
print(sum)

Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
if M == 1:
    print(0)
    sys.exit()
for i in range(M - 1):
    dif = X[i + 1] - X[i]
    A.append(dif)
for i in range(N - 1):
    A.remove(max(A))
print(sum(A))

Fixed submission:
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
sum = 0
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    A = sorted(A, reverse = True)
    for k in A[N - 1:]:
        sum += k
print(sum)

Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
if M == 1:
    print(0)
    sys.exit()
for i in range(M - 1):
    dif = X[i + 1] - X[i]
    A.append(dif)
for i in range(N - 1):
    A.remove(max(A))
print(sum(A))

Fixed submission:
import sys
N, M = map(int, input().split())
X = sorted(list(map(int,input().split())))
A = []
sum = 0
if N >= M:
    print(0)
    sys.exit()
else:
    for i in range(M - 1):
        A.append(X[i + 1] - X[i])
    A = sorted(A, reverse = True)
    for k in A[N - 1:]:
        sum += k
print(sum)
Buggy python submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Fixed submission:
import sys
weather_forecast = input()
weather_real = input()
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Buggy python submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real  = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Fixed submission:
import sys
weather_forecast = input()
weather_real = input()
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Buggy python submission (verdict: Runtime Error):
import sys
s = input().split()
weather_forecast = s[0]
weather_real  = s[1]
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

Fixed submission:
import sys
weather_forecast = input()
weather_real = input()
weather_forecast_s = list(weather_forecast)
weather_real_s = list(weather_real)
hit = 0
for i in range(3):
    if weather_forecast_s[i] == weather_real_s[i]:
        hit+=1
print(hit)

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

count = [0] * n
dif=0
start=0

for start in range(n-1):
#     print("start"+str(start))

    for i in range(start,n-1):
        dif=li[i]-li[i+1]
#         print(dif)
        if(dif<0):
            break
        count[start]+=1
#     print(count[start])

print(max(count))

Fixed submission:
s1=list(input())
s2=list(input())
count=0
for i in range(len(s1)):
    if(s1[i]==s2[i]):
        count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
c=0
count=0

while(c<B):
    if(count<1):
        c+=A
        count+=1
    else:
        c+=(A-1)
        count+=1
if(B<1.2):
    count*=0
print(count)

Fixed submission:
s1=list(input())
s2=list(input())
count=0
for i in range(len(s1)):
    if(s1[i]==s2[i]):
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split())

if(x=5):
  if(y=5):
    if(z=7):
      print("YES")
    else:
      print("NO")
  elif(y=7):
    if(z=5):
      print("YES")
    else:
      print("NO")
elif(x=7):
  if(y=5):
    if(z=5):
      print("YES")
    else:
      print("NO")
else:
  print("NO")
    

Fixed submission:
x,y,z = map(int,input().split())
 
if(x==5):
  if(y==5):
    if(z==7):
      print("YES")
    else:
      print("NO")
  elif(y==7):
    if(z==5):
      print("YES")
    else:
      print("NO")
elif(x==7):
  if(y==5):
    if(z==5):
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")

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

if(x=5 and y=7 and z=5):
  print("YES")
  
else:
  print("NO")

Fixed submission:
x,y,z = map(int,input().split())
 
if(x==5):
  if(y==5):
    if(z==7):
      print("YES")
    else:
      print("NO")
  elif(y==7):
    if(z==5):
      print("YES")
    else:
      print("NO")
elif(x==7):
  if(y==5):
    if(z==5):
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(set(s))
a = max (n.count(l[i]) - m.count(l[i]) for i in range(len(l)))

print(a if a > 0 else 0)

Fixed submission:

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(set(s))
a = max (s.count(l[i]) - t.count(l[i]) for i in range(len(l)))

print(a if a > 0 else 0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(s)
a = max (n.count(l[i]) - m.count(l[i]) for i in range(len(l)))

print(a)




Fixed submission:

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

l = list(set(s))
a = max (s.count(l[i]) - t.count(l[i]) for i in range(len(l)))

print(a if a > 0 else 0)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,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):
input(a,b)

c = a * b
if c % 2 == 0:
  print("Even")
  else:
    print("Odd")
    

Fixed submission:
a,b=map(int,input().split())
print("Even" if a*b%2==0 else "Odd")
Buggy python submission (verdict: Runtime Error):
bun = input()
str_bun = list(bun)
str_bun[0,1,2,3,] = "2","0","1","8"
str_changed = "".join(str_bun)
print(str_bun)


Fixed submission:
bun = input()
bunbun = bun.replace("2017", "2018")
print(bunbun)
Buggy python submission (verdict: Runtime Error):
n, y = map(int,input().split())
a = -1
b = -1
c = -1

for i in range(n+1):
    for j in range(n+1):
        if 0 <= n - i - j <= 2000 and y == 10000*i + 5000*j + 1000*(n - i - j):
            a = i
            b = j
            c = n - i -j
            break
print(a,b,c)


Fixed submission:
n = int(input())
d = [input() for i in range(n)]

d = set(d)

ans = len(d)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
l = []

for i in a:
	s = 0
	while i % 2 == 0:
		i = i/2
		s += 1
	l.append(s)

print(min(l))



Fixed submission:
print(int(input())%9)
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int,input().split())
s = abs(a - x)
t = abs(b - x)

print(min[s, t])

Fixed submission:
x,a,b = map(int,input().split())
s = abs(a - x)
t = abs(b - x)
ans = "A"
if s > t:
    ans = "B"

print(ans)
Buggy python submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))



Fixed submission:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)

a = l.index(max(l))
print(original_list[a])

Buggy python submission (verdict: Runtime Error):
l = list()
original_list = list()
n = int(input())
original_list = list(range(1,n))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))


Fixed submission:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)

a = l.index(max(l))
print(original_list[a])

Buggy python submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))
for num in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))

Fixed submission:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)

a = l.index(max(l))
print(original_list[a])

Buggy python submission (verdict: Runtime Error):
l = list()
n = int(input())
original_list = list(range(1,n))

for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))


Fixed submission:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)

a = l.index(max(l))
print(original_list[a])
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
		for k in z:
			if s - i - j <= (k+1) and i + j + k == s:
				ans += 1

print(ans)



Fixed submission:
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
			if 0 <= s - i - j <= k:
				ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
		for k in z:
			if s - i - j <= z and i + j + k == s:
				ans += 1

print(ans)

Fixed submission:
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
			if 0 <= s - i - j <= k:
				ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)

for i in x:
	for j in y:
		for k in z:
			if i + j + k == s:
				ans += 1

print(ans)





Fixed submission:
k,s = map(int, input().split())
ans = 0
x = range(k + 1)
y = range(k + 1)
z = range(k + 1)


for i in x:
	for j in y:
			if 0 <= s - i - j <= k:
				ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

N = int(sys.stdin.readline())
print(sum(n + 1 for n in range(N - 1)))

Fixed submission:
import sys

S = str(sys.stdin.readline())
T = str(sys.stdin.readline())

# Neglect the last newline character
num_correct = sum(1 if S[i] == T[i] else 0 for i in range(len(S[:-1])))

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

N = int(sys.stdin.readline())
print(sum(n + 1 for n in range(N - 1)))


Fixed submission:
import sys

N = int(sys.stdin.readline())
print(int((N - 1) * N // 2))

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

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))

print(sum(Ns[i] for i in range(N - 1)))

Fixed submission:
import sys

N = int(sys.stdin.readline())
print(int((N - 1) * N // 2))

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

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))
Ps = list(Ns[i + 1] for i in range(0, N - 1))
Ps.extend([Ns[0]])
#print(Ns)
#print(Ps)
mod_sum = sum(Ns[i] % Ps[i] for i in range(len(Ns)))
print(mod_sum)
#print()


Fixed submission:
import sys

N = int(sys.stdin.readline())
print(int((N - 1) * N // 2))

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

N = int(sys.stdin.readline())
Ns = list(range(1, N + 1))

Ps = list(Ns[i + 1] for i in range(0, N - 1))
Ps.extend([Ns[-1]])
#print(Ns)
#print(Ps)
mod_sum = sum(Ns[i] % Ps[i] for i in range(len(Ns)))
print(mod_sum)

Fixed submission:
import sys

N = int(sys.stdin.readline())
print(int((N - 1) * N // 2))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

num = a * b

if num % 2 == 0:
    print("Even")
else
    print("Odd")

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

if num % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
input = [a, b, c]
saidai = max(input)
nokori = input.remove(saidai)

if saidai == sum(nokori):
    print('Yes')
else:
    print('No')

Fixed submission:
a, b, c = map(int, input().split())
nyuryoku = [a, b, c]
saidai = max(nyuryoku)
nyuryoku.remove(saidai)

if saidai == sum(nyuryoku):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(n*(n-1)//2)

Fixed submission:
print(sum(s == t for s, t in zip(input(), input())))