Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in a:
    ans*=i
if ans >10**18:
    print("-1")
else:
    print(ans)
    


Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
ans = 1
if 0 in lis:
  print(0)
  exit()
for num in lis:
  ans *= num
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in a:
    ans*=i
if ans >10**18:
    print("-1")
else:
    print(ans)
    


Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
ans = 1
if 0 in lis:
  print(0)
  exit()
for num in lis:
  ans *= num
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
k=int(input())
ans=0

for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            d=math.gcd(i,j)
            ans+=math.gcd(d,l)
print(ans)

Fixed submission:
import math
k=int(input())
ans=0

for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            d=math.gcd(i,j)
            ans+=math.gcd(d,l)
print(ans)
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
a=list(map(int,input().split()))
if a[-1]-a[0]<=(k-a[-1])+a[0]:
    print(a[-1]-a[0])
else:
    for i in range(n-1):
        if a[-1]-a[i]>(k-a[-1])+a[i]:
            start=i
        else:
            break
print(((k-a[-1])+a[start])+(a[-1]-a[start+1]))

Fixed submission:
K,N = map(int, input().split())
A = [int(a) for a in input().split()]

ans = A[-1]-A[0]
for i in range(N-1):
    ans = min(ans, K-A[i+1]+A[i])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=sorted([x for x in set(a) if a.count(x)>1], key=a.index)
c=[a.count(i) for i in b]
ans=0
for i in c:
    ans+=((i-1)*i)//2

cnt=ans   
for i in range(n):
   if a[i] in b:
       ans-=(c[b.index(a[i])]-1)
       print(ans)
       ans=cnt
   else:
       print(ans)

Fixed submission:
N = int(input())
A = [int(a)-1 for a in input().split()]
X = [0] * N
for a in A:
    X[a] += 1
s = 0
for x in X:
    s += x * (x-1) // 2

for a in A:
    print(s - (X[a] - 1))
Buggy python submission (verdict: Runtime Error):
a=input()

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print"No"

Fixed submission:
a=input()

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())

ball=""
cnt=0

for i in range(n//(a+b)+1):
    ball+="b"*a
    ball+="r"*b
for i in range(n):
    if ball[i]=="b":
        cnt+=1
print(cnt)

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[input() for i in range(n)]
cnt=0
ans=[]

for i in s:
    cnt=max(cnt,s.count(i))

for j in s:
    if cnt==s.count(j):
        if j not in ans:
            ans.append(j)

ans=sorted(ans)
for k in ans:
    print(k)

Fixed submission:
import collections as co
n=int(input())
s=[input() for i in range(n)]

x=co.Counter(s)
x=x.most_common()
ans=[]
m=0

for i in x:
    if i[1]<m:
        break
    else:
        ans.append(i[0])
        m=i[1]

ans.sort()
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
s=input()
ans=""

for i in range(len(a)):
	ans+="x"

print(ans)

Fixed submission:
s=input()
ans=""

for i in range(len(s)):
	ans+="x"

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

for i in itertools.combinations(a,2):
	if i[0]==i[1]:
		print("NO")
		exit()
		
print("YES")

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

if n==len(s):
	print("YES")
else:
	print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

for i in itertools.combinations(a,2):
	if i[0]==i[1]:
		print("NO")
		exit()
		
print("YES")

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

if n==len(s):
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
h,a=map(int,input().split())
print(h//a if h%a+==0 else (h//a)+1)

Fixed submission:
h,a=map(int,input().split())
print(h//a if h%a==0 else (h//a)+1)

Buggy python submission (verdict: Runtime Error):
h,a=map(int,input.split())
print(h//a)

Fixed submission:
h,a=map(int,input().split())
print(h//a if h%a==0 else (h//a)+1)
Buggy python submission (verdict: Runtime Error):
list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
ans=input()

for i in list:
	if i==ans:
		print(list[list.index(i)+1])

Fixed submission:
list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=input()

for i in list:
	if i==ans:
		print(list[list.index(i)+1])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*n+1
WA=[0]*n+1

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)

Fixed submission:
n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*(n+1)
WA=[0]*(n+1)

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)
Buggy python submission (verdict: Runtime Error):
k,x=map(int,input().split())
if 500*k=>x:
  print("Yes")
else:
  print("No")

Fixed submission:
k,x=map(int,input().split())
if 500*k>=x:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s,t=map(input().split())
ans=t+s
print(ans)

Fixed submission:
s,t=input().split()
ans=t+s
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

print(a*b//math.gcd(a,b))

Fixed submission:
def gcd(m,n):
	x=max(m,n)
	y=min(m,n)
	if x%y==0:
		return y
	else:
		while x%y!=0:
			z=x%y
			x=y
			y=z
		else:
			return z

def lcm(m,n):
	return int(m*n/gcd(m,n))
	
	
a,b=map(int,input().split())
print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=ord(input())

ans=s-65+n
if ans>=26:
  ans=ans%26
print(chr(ans+65))


Fixed submission:
N = int(input())
S = input()

ans = ''
for c in S:
    i = ord(c) - ord('A')
    i = (i+N)%26
    ans += chr(i + ord('A'))
print(ans)

Buggy python submission (verdict: Runtime Error):
s=ord(input())
n=int(input())
ans=s-65+n
if ans>=26:
  ans=ans%26
print(chr(ans+65))


Fixed submission:
N = int(input())
S = input()

ans = ''
for c in S:
    i = ord(c) - ord('A')
    i = (i+N)%26
    ans += chr(i + ord('A'))
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=0
for i in n:
  if i%2==1:
    ans+=1
print(ans/n)

Fixed submission:
x = int(input())
f = x // 2
print((x-f)/x)
Buggy python submission (verdict: Runtime Error):
s=input()
if s ==　"Sunny":
    print("Cloudy")
elif s ==　"Cloudy":
    print("Rainy")
else:
    print("Sunny")


Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")

Buggy python submission (verdict: Runtime Error):
s=input()
if s ==　Sunny:
    print("Cloudy")
if s ==　Cloudy:
    print("Rainy")
else:
    print("Sunny")


Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")

Buggy python submission (verdict: Runtime Error):
s=input()
if s ==　"Sunny":
    print("Cloudy")
if s ==　"Cloudy":
    print("Rainy")
else:
    print("Sunny")

Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int, input().split()))
ans = b[0]
for i in range(len(b)-1):
  ans.append(min(b[i], b[i+1]))
ans += b[-1]
print(ans)


Fixed submission:
n=int(input())
print(n**3)

Buggy python submission (verdict: Runtime Error):
n = int(input())
b = list(map(int, input().split()))
ans = b[0]
for i in range(len(b)-1):
  ans.append(min(b[i], b[i+1]))
  ans += b[-1]
print(ans)


Fixed submission:
n=int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=input()

if a >=　3200:
  print(s)
else:
  print("red")

Fixed submission:
a=int(input())
s=input()

if a>=3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
s=input()
if int(s[0])==int(s[1]) or int(s[1])==int(s[2]) or int(s[2])=int(s[3]):
  print("Bad")
else:
  print("Good")

Fixed submission:
s=input()
a=int(s[0])-int(s[1])
b=int(s[1])-int(s[2])
c=int(s[2])-int(s[3])
if a!=0 and b!=0 and c!=0:
  print("Good")
else:
  print("Bad")

Buggy python submission (verdict: Runtime Error):
s=int(input())
if s[0]==s[1] or s[1]==s[2] or s[2]=s[3]:
  print("Good")
else:
  print("Bad")

Fixed submission:
s=input()
a=int(s[0])-int(s[1])
b=int(s[1])-int(s[2])
c=int(s[2])-int(s[3])
if a!=0 and b!=0 and c!=0:
  print("Good")
else:
  print("Bad")
Buggy python submission (verdict: Runtime Error):
p,q,r=map(int,input().split())
print(min(p+q,q+r,r+p)

Fixed submission:
p,q,r=map(int,input().split())
print(min(p+q,q+r,r+p))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
mod=10**9+7
a=[int(input()) for i in range(m)]
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%mod
    if i in a:
        dp[i]=0
print(int(dp[n]))

Fixed submission:
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
mod=10**9+7
broken=[False for _ in range(n+1)]
for _ in range(m):
    broken[int(input())]=True
    
for i in range(1,n+1):
    if broken[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod

print(dp[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for i in range(m)]
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(1e9+7)
    if i in a:
        dp[i]=0
print(int(dp[n]))

Fixed submission:
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
mod=10**9+7
broken=[False for _ in range(n+1)]
for _ in range(m):
    broken[int(input())]=True
    
for i in range(1,n+1):
    if broken[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod

print(dp[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for i in range(m)]
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(1e9+7)
    if i in a:
        dp[i]=0
print(int(dp[n]))

Fixed submission:
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
mod=10**9+7
broken=[False for _ in range(n+1)]
for _ in range(m):
    broken[int(input())]=True
    
for i in range(1,n+1):
    if broken[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod

print(dp[n])
Buggy python submission (verdict: Runtime Error):

if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=13:
  print(b)
if 6<=a<=12:
  pritn(b/2)
if a<=5:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=13:
  print(b)
elif 6<=a<=12:
  pritn(b//2)
else:
  print(0)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)
Buggy python submission (verdict: Runtime Error):
n,k=int(input())
s=input()
str.lower(s[k])
print(s)

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

s[k-1] = s[k-1].lower()

print(''.join(s))
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k=[int(input()) for i in range(5)]
print("Yay!" if e-a<=k else ":(")

Fixed submission:
a,b,c,d,e,k=[int(input()) for i in range(6)]
print("Yay!" if e-a<=k else ":(")
Buggy python submission (verdict: Runtime Error):
n=input()
print(min(abs(int(n[i:i+3])-753 for i in range(len(n)))))

Fixed submission:
n=input()
print(min(abs(int(n[i:i+3])-753) for i in range(len(n))))
Buggy python submission (verdict: Runtime Error):
print(int(input())+(int(input())//2))

Fixed submission:
x,y=map(int,input().split())
print(x+(y//2))
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
l=[list(map(input().split())) for i in range(h)]

row=[False]*h
col=[False]*w

for i in range(h):
  for j in range(w):
    if a[i][j]=="#":
      row[i]="True"
      col[j]="True"

for i in range(h):
  if row[i]:
    for j in range(w):
      if col[j]:
        print(a[i][j], end="")
    print()

Fixed submission:
H, W = map(int, input().split())
a = []
for _ in range(H):
    i = list(input())
    if '#' in i:
        a.append(i)
ans = zip(*[i for i in zip(*a) if '#' in i])
for s in ans:
    print(*s, sep='')
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=n//k
b=n%k
print(a+b)-a

Fixed submission:
n,k=map(int,input().split())
if n%k!=0:
  print("1")
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
s=input()
ams=0

for i in s:
  if s[i]==+:
    ans+=1
  else:
    ans-=1
    
print(ans)

Fixed submission:
s=input()
print(s.count("+")-s.count("-"))
Buggy python submission (verdict: Runtime Error):
n=input()
print("No" if int(n)%sum(map(int,input())) else "Yes")

Fixed submission:
n=int(input())
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt//=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input)
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt/=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt//=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=sum(list(str(n)))

if n%s==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt//=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0

for a in list(map(int,input().split())):
  while not a%2:
    ans+=1
    a//2
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    while a % 2 == 0:
        a /= 2
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break

print(c)

Fixed submission:
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
    else:break

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
print(c)

Fixed submission:
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
    else:break

print(c)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=[int(input()) for i in range(n)]

print(n+(x-sum(l)//min(l))

Fixed submission:
n,x=map(int,input().split())
l=[int(input()) for i in range(n)]

print(n+(x-sum(l))//min(l))
Buggy python submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
a=map(int,input().split())

left=0
right=0

for ai in a:
  if ai<x:
    left+=1
  else:
    rihgt+=1
print(min(left,right))

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

left=0
right=0

for ai in a:
  if ai<x:
    left+=1
  else:
    right+=1
print(min(left,right))
Buggy python submission (verdict: Runtime Error):
n=str(input())
print("Yes" if n%sum(map(int,n))==0 else "No")

Fixed submission:
n=input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")
Buggy python submission (verdict: Runtime Error):
a,b=2,1
for i in range(int(input()):
               a,b=b,(a+b)
print(a)

Fixed submission:
a,b=2,1
for i in range(int(input())):
  a,b=b,(a+b)
print(a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print("Yes" if n[0]==n[2] else "No")

Fixed submission:
a,b,c=input()
print("Yes" if a==c else "No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2], *A[N%2::2])

Fixed submission:
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
 
print(*B)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Fixed submission:
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
 
print(*B)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Fixed submission:
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
 
print(*B)

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

print(*a[::-2],*a[n%2::2])

Fixed submission:
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
 
print(*B)
Buggy python submission (verdict: Runtime Error):
a,b,c===input().split()
print((a[0]+b[0]+c[0]).upper())

Fixed submission:
a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())
Buggy python submission (verdict: Runtime Error):
W,a,b=map(int,input().split())
print(min(abs(a-b)-w,0))

Fixed submission:
w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))
Buggy python submission (verdict: Runtime Error):
input()
s=input()
n,m=0

for i in range(len(s)):
  if s[i]=="I":
    n+=1
    m=max(n,m)
  if s[i]=="D":
    n=n-1
    m=max(n,m)
print(m)

Fixed submission:
input()
s=input()
n,m=0,0

for i in range(len(s)):
  if s[i]=="I":
    n+=1
    m=max(n,m)
  if s[i]=="D":
    n=n-1
    m=max(n,m)
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().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().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-x-y<=k:
            ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
cnt=0
k,s=map(int,input().split())
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l==s:
                cnt+=1
print(cnt)

Fixed submission:
k,s=map(int,input().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-x-y<=k:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
if b=="+":
  print(int(a)+int(c))
else b=="-":
  print(int(a)-int(c))


Fixed submission:
a,b,c=input().split()
if b=="+":
  print(int(a)+int(c))
else:
  print(int(a)-int(c))
Buggy python submission (verdict: Time Limit Exceeded):
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs, all = {}, 0
for k in count.keys():
    c = comb(count[k], 2)
    combs[k] = c
    all += c

for a in A:
    ans = all - combs[a] + comb(count[a]-1,2)
    print(int(ans))


Fixed submission:
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
combs_minas_one = {k:comb(count[k]-1, 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + combs_minas_one[a]
    print(int(ans))

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + comb(count[a]-1,2)
    print(int(ans))


Fixed submission:
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
combs_minas_one = {k:comb(count[k]-1, 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + combs_minas_one[a]
    print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + comb(count[a]-1,2)
    print(int(ans))


Fixed submission:
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
combs_minas_one = {k:comb(count[k]-1, 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + combs_minas_one[a]
    print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = (int(i) for i in input().split())
P = [int(i) for i in input().split()]

probs = []
for p in P:
    prob = 0
    for i in range(1,p+1):
        prob += i * (1/p)
    probs.append(prob)

ans = 0
for i in range(n-k+1):
    ans = max(ans, sum(probs[i:i+k]))
print(ans)

Fixed submission:
import itertools
n, k = (int(i) for i in input().split())
P = [int(i) for i in input().split()]

probs = list(itertools.accumulate([(1+p)/2 for p in P]))
probs.insert(0,0)

ans = 0

for i in range(n-k+1):
    ans = max(ans, -probs[i]+probs[i+k])

print(ans)
Buggy python submission (verdict: Runtime Error):
from sympy import sieve
 
def Eratosthenes(n):
    li = [i for i in range(2,n+1)]
    judge = [True for i in range(n+1)]
    ans = []
 
    for i in range(2,n+1):
        if judge[i] == True:
            for j in range(i*2,n+1,i):
                judge[j] = False
            ans.append(i)
    return ans
 
x = int(input())
l = Eratosthenes(10 ** 6)
for i in l:
    if i >= x:
        print(i)
        exit()

Fixed submission:
def Eratosthenes(n):
    li = [i for i in range(2,n+1)]
    judge = [True for i in range(n+1)]
    ans = []
 
    for i in range(2,n+1):
        if judge[i] == True:
            for j in range(i*2,n+1,i):
                judge[j] = False
            ans.append(i)
    return ans
 
x = int(input())
l = Eratosthenes(10 ** 6)
for i in l:
    if i >= x:
        print(i)
        exit()