Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
Md,MN=1000000007,1000006
fac,ifac,a,res,inv=[1,1],[1,1],[0],0,[1,1]
for i in range(2,MN):
    inv.append(inv[Md%i]*(Md-Md/i)%Md)
    fac.append(fac[-1]*i%Md)
    ifac.append(ifac[-1]*inv[i]%Md)
def C(x,y):
    if(x<y):
        return 0
    return fac[x]*ifac[y]*ifac[x-y]
def D(x,y):
    return C(x-y+1,y)

n=int(input())
for i in range(1,n):
    if i*2-n>=0:
        a.append(D(n-3,n-i-1)*fac[i]*fac[n-i-1]%Md)
    else:
        a.append(0)
for i in range(n-1,0,-1):
    a[i]=(a[i]-a[i-1])%Md
    res=res+a[i]*i
res=res%Md
print(res)


Fixed submission:
Md,MN=1000000007,1000006
fac,ifac,a,res,inv=[1,1],[1,1],[0],0,[1,1]
for i in range(2,MN):
    inv.append(inv[Md%i]*(Md-Md//i)%Md)
    fac.append(fac[-1]*i%Md)
    ifac.append(ifac[-1]*inv[i]%Md)
def C(x,y):
    if(x<y):
        return 0
    return fac[x]*ifac[y]*ifac[x-y]
def D(x,y):
    return C(x-y+1,y)

n=int(input())
for i in range(1,n):
    if i*2-n>=0:
        a.append(D(n-3,n-i-1)*fac[i]*fac[n-i-1]%Md)
    else:
        a.append(0)
for i in range(n-1,0,-1):
    a[i]=(a[i]-a[i-1])%Md
    res=res+a[i]*i
res=res%Md
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
Md,MN=1000000007,1000006
fac,ifac,a,res=[1],[1],[0],0
for i in range(1,MN):
    fac.append(fac[-1]*i%Md)
    ifac.append(pow(fac[-1],Md-2,Md))
def C(x,y):
    if(x<y):
        return 0
    return fac[x]*ifac[y]*ifac[x-y]
def D(x,y):
    return C(x-y+1,y)

n=int(input())
for i in range(1,n):
    if i*2-n>=0:
        a.append(D(n-3,n-i-1)*fac[i]*fac[n-i-1]%Md)
    else:
        a.append(0)
for i in range(n-1,0,-1):
    a[i]=(a[i]-a[i-1])%Md
    res=res+a[i]*i
res=res%Md
print(res)


Fixed submission:
Md,MN=1000000007,1000006
fac,ifac,a,res,inv=[1,1],[1,1],[0],0,[1,1]
for i in range(2,MN):
    inv.append(inv[Md%i]*(Md-Md//i)%Md)
    fac.append(fac[-1]*i%Md)
    ifac.append(ifac[-1]*inv[i]%Md)
def C(x,y):
    if(x<y):
        return 0
    return fac[x]*ifac[y]*ifac[x-y]
def D(x,y):
    return C(x-y+1,y)

n=int(input())
for i in range(1,n):
    if i*2-n>=0:
        a.append(D(n-3,n-i-1)*fac[i]*fac[n-i-1]%Md)
    else:
        a.append(0)
for i in range(n-1,0,-1):
    a[i]=(a[i]-a[i-1])%Md
    res=res+a[i]*i
res=res%Md
print(res)
Buggy python submission (verdict: Runtime Error):
A, B, T = int(sys.stdin.readline().strip())
return T // A * B

Fixed submission:
import sys 
A, B, T = list(map(int, sys.stdin.readline().strip().split()))
print(T // A * B)

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

def gcd_(a, b):
    a_ = max(a, b)
    b_ = min(a, b)

    while True:
        if a_ % b_ == 0:
            return b_
        a_, b_ = b_, a_ % b_

_ = input()
a = np.array([int(x) for x in input().split(" ")])

if len(a) == 2:
    print(gcd_(*a))
    exit()

list = [gcd_(a[2], a[1]), gcd_(a[0], a[2]), gcd_(a[0], a[1])]
gcd = np.max(list)
bad_num = a[np.argmax(list)]

for i in range(3, len(a)):
    if a[i] % gcd == 0:
        continue
    else:
        newgcd = gcd_(a[i], gcd)
        oldgcd = gcd_(bad_num, gcd)

        if newgcd > oldgcd:
            gcd = newgcd
        else:
            gcd = oldgcd
            bad_num = a[i]


print(int(gcd))


Fixed submission:
a, b, t = [int(x) for x in input().split(" ")]

print(b * int(t / a))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = [int(x) for x in input().split()]
s = input()

zero_list = np.array([len(x) for x in s.split("1") if len(x) > 0])
one_list = np.array([len(x) for x in s.split("0") if len(x) > 0])

if k >= len(zero_list):
    print(len(s))
else:
    max_num = 0

    if len(zero_list) < len(one_list):
        for i in range(len(zero_list) - k + 1):
            tmp = zero_list[i:i+k].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
    else:
        if len(zero_list) == len(one_list) and int(s[0]) == 1:
            zero_list = np.array([0, *zero_list])
        max_num = zero_list[:k].sum() + one_list[:k].sum()
        for i in range(len(one_list) - k):
            tmp = zero_list[i+1:i+k+1].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
        tmp = zero_list[-k:].sum() + one_list[-k:].sum()
        if tmp > max_num:
            max_num = tmp

    print(max_num)

Fixed submission:
import numpy as np

n, k = [int(x) for x in input().split()]
s = input()

zero_list = np.array([len(x) for x in s.split("1") if len(x) > 0])
one_list = np.array([len(x) for x in s.split("0") if len(x) > 0])

if k >= len(zero_list):
    print(len(s))
else:
    max_num = 0

    if len(zero_list) < len(one_list):
        for i in range(len(zero_list) - k + 1):
            tmp = zero_list[i:i+k].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
    else:
        if len(zero_list) == len(one_list) and int(s[0]) == 1:
            zero_list = np.insert(zero_list, 0, 0)
        max_num = zero_list[:k].sum() + one_list[:k].sum()
        for i in range(len(one_list) - k):
            tmp = zero_list[i+1:i+k+1].sum() + one_list[i:i+k+1].sum()
            if tmp > max_num:
                max_num = tmp
        tmp = zero_list[-k:].sum() + one_list[-k:].sum()
        if tmp > max_num:
            max_num = tmp

    print(max_num)
Buggy python submission (verdict: Runtime Error):
import sys
raw_input = sys.stdin.readline
N,K = map(int,raw_input().split())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(K):
        if i+j+1 < N:
            dp[i+j+1] = min(dp[i]+abs(nums[i]-nums[i+j+1]),dp[i+j+1])
print dp[N-1]

Fixed submission:
N = int(raw_input())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    if i<N-1:
        dp[i+1] = min(dp[i+1],dp[i]+abs(nums[i+1]-nums[i]))
    if i<N-2:
        dp[i+2] = min(dp[i+2],dp[i]+abs(nums[i+2]-nums[i]))
print dp[N-1]
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,raw_input().split())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(K):
        if i+j+1 < N:
            dp[i+j+1] = min(dp[i]+abs(nums[i]-nums[i+j+1]),dp[i+j+1])
print dp[N-1]

Fixed submission:
import sys
raw_input = sys.stdin.readline
N,K = map(int,raw_input().split())
nums = list(map(int,raw_input().split()))
dp = [10000000000 for x in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(K):
        if i+j+1 < N:
            dp[i+j+1] = min(dp[i]+abs(nums[i]-nums[i+j+1]),dp[i+j+1])
print dp[N-1]
Buggy python submission (verdict: Runtime Error):
n = input().split()
ans = int( int(n[2]+0.5) / n[1]   ) * n[1]
print(ans)

Fixed submission:
n = input().split()
ans = int( (int(n[2]) + 0.5) / int(n[0])) * int(n[1])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = input().split()
print(int((n[2] + 0.5 ) / n[0]) * n[1])

Fixed submission:
n = input().split()
ans = int( (int(n[2]) + 0.5) / int(n[0])) * int(n[1])
print(ans)

Buggy python submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main()
{
    int a,b,t;

    cin >> a >> b >> t;

    cout << t/a*b;

    return 0;
}

Fixed submission:
a,b,t=map(int,input().split())
ans=t//a*b
print(ans)
Buggy python submission (verdict: Runtime Error):
ipt=input()
lst=ipt.split()
A=lst[0]
B=lst[1]
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)


Fixed submission:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)

Buggy python submission (verdict: Runtime Error):
a=A
b=B
if a>=b and a-1>=b:
	print(a+a-1)
elif a>=b and a-1<b:
	print(a+b)
elif a<b and a<b-1:
	print(b+b-1)
else:
	print(a+b)


Fixed submission:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)

Buggy python submission (verdict: Runtime Error):
if A>=B and A-1>=B:
	print(A+A-1)
elif A>=B and A-1<B:
	print(A+B)
elif A<B and A<B-1:
	print(B+B-1)
else:
	print(A+B)


Fixed submission:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)

Buggy python submission (verdict: Runtime Error):
if A>=B and A-1>=B:
  print(A+A-1)
 	elif A>=B and A-1<B:
      print(A+B)
  	elif A<B and A<B-1:
      print(B+B-1)
    else:
      print(A+B)

Fixed submission:
ipt=input()
lst=ipt.split()
A=int(lst[0])
B=int(lst[1])
if A>=B and A-1>=B:
    print(A+A-1)
elif A>=B and A-1<B:
    print(A+B)
elif A<B and A<B-1:
    print(B+B-1)
else:
    print(A+B)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
if r==[]:
    r_min=10
else:
    r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a%10==0:
    a_q=a
else:
    a_q=(a//10+1)*10
if b%10==0:
    b_q=b
else:
    b_q=(b//10+1)*10
if c%10==0:
    c_q=c
else:
    c_q=(c//10+1)*10
if d%10==0:
    d_q=d
else:
    d_q=(d//10+1)*10
if e%10==0:
    e_q=e
else:
    e_q=(e//10+1)*10

r=[i for i in [a%10,b%10,c%10,d%10,e%10]  if i%10!=0]
if r==[]:
    r_min=10
else:
    r_min=min(r)

ans=a_q+b_q+c_q+d_q+e_q-10+r_min
print(ans)
Buggy python submission (verdict: Runtime Error):
b=input()
if b="A":
  print("T")
elif b="T":
  print("A")
elif b="C":
  print("G")
else:
  print("C")

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="C":
  print("G")
else:
  print("C")
Buggy python submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)

Fixed submission:
ABClist=input().split()
AB=int(ABClist[0])
BC=int(ABClist[1])
ans=int(AB*BC/2)
print(ans)

Buggy python submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)

Fixed submission:
ABClist=input().split()
AB=int(ABClist[0])
BC=int(ABClist[1])
ans=int(AB*BC/2)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
        ans=a.index(4)+4
if s==1 or s==2:
    print(4)
else:
    print(ans)

Fixed submission:
s=int(input())
a=[s]
for i in range(500):
    if a[i]%2==0:
        a.append(a[i]//2)
    else:
        a.append(a[i]*3+1)
if s==1 or s==2:
    print(4)
else:
    print(a.index(4)+4)
Buggy python submission (verdict: Runtime Error):
n_list=input().split()
n_list_int=[int(n) for n in n_list]
n_list_int.sort()
ans=n_list_sort[2]*10+n_list_sort[1]+n_list_sort[0]
print[ans]

Fixed submission:
abclist=input().split()
abclist_int=[int(i) for i in abclist]
abclist_int.sort()
ans=abclist_int[2]*10+abclist_int[1]+abclist_int[0]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
ab=[]
for i in range(a,b+1):
    ab.append(i)
cd=ab
ab_min=ab[:k]
ab_max=cd[b+1-a-k:]

anslist=list(set(ab_min)|set(ab_max))
anslist.sort()

for k in range(len(anslist)):
    print(anslist[k])


Fixed submission:
a,b,k=map(int,input().split())
ab_min=[]
ab_max=[]
for i in range(a,min(b+1,a+k)):
    ab_min.append(i)
for j in range(max(a,b+1-k),b+1):
    ab_max.append(j)

ans=list(set(ab_min)|set(ab_max))
ans.sort()

for k in range(len(ans)):
    print(ans[k])

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
ab=[]
for i in range(a,b+1):
    ab.append(i)
ab_min=ab[:k]
ab=[]
for j in range(a,b+1):
    ab.append(j)
ab_max=ab[b+1-a-k:]

anslist=list(set(ab_min)|set(ab_max))
anslist.sort()

for k in range(len(anslist)):
    print(anslist[k])


Fixed submission:
a,b,k=map(int,input().split())
ab_min=[]
ab_max=[]
for i in range(a,min(b+1,a+k)):
    ab_min.append(i)
for j in range(max(a,b+1-k),b+1):
    ab_max.append(j)

ans=list(set(ab_min)|set(ab_max))
ans.sort()

for k in range(len(ans)):
    print(ans[k])
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a+b>c+d:
    print("Left")
elif a+b=c+d:
    print("Balanced")
else:
    print("Right")

Fixed submission:
a,b,c,d=map(int,input().split())
if a+b>c+d:
    print("Left")
elif a+b==c+d:
    print("Balanced")
else:
    print("Right")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a+b)/2%=0:
    ans=(a+b)//2
else:
    ans=(a+b)//2+1
print(ans)

Fixed submission:
a,b=map(int,input().split())
if (a+b)%2==0:
    ans=(a+b)//2
else:
    ans=(a+b)//2+1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
ans=0
if a==1:
    ans+=1
if b==1:
    ans+=1
if c==1:
    ans+=1
print(ans)

Fixed submission:
abc=input()
a=int(abc[0])
b=int(abc[1])
c=int(abc[2])
ans=0
if a==1:
    ans+=1
if b==1:
    ans+=1
if c==1:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]

ans_list=[]
for j in range(n):
    m=0
    while a[j]%2==0:
        m+=1
        a[j]=a[j]//2
    ans_list.append(m)
ans_list.sort()
print(ans_list[0])

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

ans=0
for i in range(30):
    a=[a[j]/2 for j in range(n) if a[j]%2==0]
    ans+=1
    if len(a)!=n:
        break

print(ans-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n>=90 or n=9 or n=19 or n=29 or n=39 or n=49 or n=59 or n=69 or n=79 or n=89:
    print("Yes")
else:
    print("No")

Fixed submission:
n=int(input())
if n>=90 or n==9 or n==19 or n==29 or n==39 or n==49 or n==59 or n==69 or n==79 or n==89:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a<=b and b<=c:
    ans=a+b
elif a<=b and c<=b:
    ans=a+c
elif b<=a and c<=b:
    ans=b+c
print(ans)

Fixed submission:
a,b,c=map(int,input().split())
maxim=max(a,b,c)
ans=a+b+c-maxim
print(ans)
Buggy python submission (verdict: Runtime Error):
o=input()
e=input()
ans=""
if len(o)==len(e):
    for i in range(len(e)):
        ans+=o[i]+e[i]
else:
    for j in range(len(e)):
        ans+=o[i]+e[i]
    ans+=o[-1]
print(ans)

Fixed submission:
o=input()
e=input()
ans=""
if len(o)==len(e):
    for i in range(len(e)):
        ans+=o[i]+e[i]
else:
    for j in range(len(e)):
        ans+=o[j]+e[j]
    ans+=o[-1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, Y = map(int, input().strip().split())

# s :  1000円札の枚数
# g :  5000円札の枚数
# i : 10000円札の枚数

ans = '-1 -1 -1'

for s in range(N + 1):
    for g in range(N + 1 - s):
        for i in range(N + 1 - s - g):
            money = 1000 * s + 5000 * g + 10000 * i
            if money == Y:
                ans = str(i) + " " + str(g) + " " + str(s)
                

print(ans)

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

# s :  1000円札の枚数
# g :  5000円札の枚数
# i : 10000円札の枚数

ans = '-1 -1 -1'
flag = 0

for s in range(N + 1):
    if flag == 1:
        break

    for g in range(N + 1 - s):
        i = N - s - g
        money = 1000 * s + 5000 * g + 10000 * i
        if money == Y:
            ans = str(i) + " " + str(g) + " " + str(s)
            flag = 1
            break


print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().strip().split())

a_b = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    a_b.append(array)

c_d = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    c_d.append(array)

for n in range(N):
    mind = 200000001
    for m in range(M):
        dist = abs(a_b[n][0] - c_d[m][0]) + abs(a_b[n][1] - c_d[m][1])
        if dist < mind:
            mind = dist
            checkpoint = m + 1
    print(checkpoint)


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

a_b = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    a_b.append(array)

c_d = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    c_d.append(array)

for n in range(N):
    mind = 1000000007
    for m in range(M):
        dist = abs(a_b[n][0] - c_d[m][0]) + abs(a_b[n][1] - c_d[m][1])
        if dist < mind:
            mind = dist
            checkpoint = m + 1
    print(checkpoint)

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

a_b = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    a_b.append(array)

c_d = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    c_d.append(array)

for n in range(N):
    mind = 2 * 10^8 + 1
    for m in range(M):
        dist = abs(a_b[n][0] - c_d[m][0]) + abs(a_b[n][1] - c_d[m][1])
        if dist < mind:
            mind = dist
            checkpoint = m + 1
    print(checkpoint)


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

a_b = []
for i in range(N):
    array = list(map(int, input().strip().split()))
    a_b.append(array)

c_d = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    c_d.append(array)

for n in range(N):
    mind = 1000000007
    for m in range(M):
        dist = abs(a_b[n][0] - c_d[m][0]) + abs(a_b[n][1] - c_d[m][1])
        if dist < mind:
            mind = dist
            checkpoint = m + 1
    print(checkpoint)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().strip().split())

ans = 0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if (x+y+z) == S:
                ans += 1

print(ans)

Fixed submission:
K, S = map(int, input().strip().split())

ans = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - (x + y)
        if z >= 0 and z <= K:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
   k=V[j]-C[j]
   if k>0:
      n+=k
print(n)

Fixed submission:
A,B,T=map(int,input().split(" "))
ans=T//A*B
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
n=0
for j in range(N):
 k=V[j]-C[j]
 if k>0:
   n+=k
print(n)

Fixed submission:
A,B,T=map(int,input().split(" "))
ans=T//A*B
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if b%a == 0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
A, B = map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if b%a == 0:
    print(A+B)
else:
    print(B-A)

Fixed submission:
A, B = map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)
Buggy python submission (verdict: Runtime Error):
s, t = input(), input()
for i in range(len(s)):
    if t = s[len(t)-i:]+s[i:len(t)-i]:
        print('Yes')
        break
else:
    print('No')

Fixed submission:
s, t = input(), input()
for i in range(len(s)):
    if t == s[len(s)-i:]+s[:len(s)-i]:
        print('Yes')
        break
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n,m,d = map(int, input().split())
ans = (n-d)*2 * n**(m-2) * (m-1) / (n**m)
if d == 0:
    ans /= 2
print(ans)

Fixed submission:
n,m,d = map(int, input().split())
ans = (n-d)*2  * (m-1) / (n**2)
if d == 0:
    ans /= 2
print(ans)
Buggy python submission (verdict: Runtime Error):
Nstr = input()
SN = 0
for i in N:
    SN += int(i)
if int(N) % SN == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
Nstr = input()
SN = 0
for i in Nstr:
    SN += int(i)
if int(Nstr) % SN == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(sum(range(b-a)-a))

Fixed submission:
a, b = map(int, input().split())
print(sum(range(b-a))-a)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(sum(range(b-a)-a)

Fixed submission:
a, b = map(int, input().split())
print(sum(range(b-a))-a)
Buggy python submission (verdict: Time Limit Exceeded):
def inpl(): return list(map(int, input().split()))
n = int(input())
a = inpl()
#sa = sorted(a)
maximum = max(a)
c = 0
while True:
    if maximum//2-c in a:
        print(maximum, maximum//2-c)
        break
    elif maximum-maximum//2+c in a:
        print(maximum, maximum-maximum//2+c)
        break
    else:
        c += 1

Fixed submission:
def inpl(): return list(map(int, input().split()))
n = int(input())
a = inpl()
maximum = max(a)
diff = maximum/2
a.remove(maximum)
min_num = [abs(i - diff) for i in a]
min_num = a[min_num.index(min(min_num))]
print(maximum, min_num)

Buggy python submission (verdict: Time Limit Exceeded):
def inpl(): return list(map(int, input().split()))
n = int(input())
a = inpl()
#sa = sorted(a)
maximum = max(a)

while True:
    c = 0
    if maximum//2-c in a:
        print(maximum, maximum//2)
        break
    elif maximum-maximum//2+c in a:
        print(maximum, maximum-maximum//2+c)
        break
    else:
        c += 1
    

Fixed submission:
def inpl(): return list(map(int, input().split()))
n = int(input())
a = inpl()
maximum = max(a)
diff = maximum/2
a.remove(maximum)
min_num = [abs(i - diff) for i in a]
min_num = a[min_num.index(min(min_num))]
print(maximum, min_num)