Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=[0]
for i in range(n+1):
  l.append(2**(i+1)-1)
m=[0]
for i in range(n+1):
  m.append(2**(i+2)-3)
c=0
for i in range(n,-1,-1):
  if x<2**(i+1)-1:
    x-=1
  elif x==2**(i+1)-1:
    c+=l[i]+1
    x=0
  elif x>2**(i+1)-1:
    c+=l[i]+1
    elif x==m[i+1]:
      x-=1
    x=x-(2**(i+1)-1)
print(c)

Fixed submission:
n,x=map(int,input().split())
l=[]
for i in range(n+1):
  l.append(2**(i+1)-1)
m=[]
for i in range(n+1):
  m.append(2**(i+2)-3)
c=0
for i in range(n,-1,-1):
  if x<2**(i+1)-1:
    x-=1
  elif x==2**(i+1)-1:
    if i!=0:
      c+=l[i-1]+1
    elif i==0:
      c+=1
    x=0
  elif x>2**(i+1)-1:
    if i!=0:
      c+=l[i-1]+1
    elif i==0:
      c+=1
    elif x==m[i]:
      x-=1
    x=x-(2**(i+1)-1)
print(c)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=[0]
for i in range(n+1):
  l.append(2**(i+1)-1)
m=[0]
for i in range(n+1):
  m.append(2**(i+2)-3)
c=0
for i in range(n,-1,-1):
  if x<2**(i+1)-1:
    x-=1
  elif x==2**(i+1)-1:
    c+=l[i]+1
    x=0
  elif x>2**(i+1)-1:
    c+=l[i]+1
    elif x==m[i+1]:
      x-=1
    x=x-(2**(i+1)-1)
print(c)

Fixed submission:
n,x=map(int,input().split())
l=[]
for i in range(n+1):
  l.append(2**(i+1)-1)
m=[]
for i in range(n+1):
  m.append(2**(i+2)-3)
c=0
for i in range(n,-1,-1):
  if x<2**(i+1)-1:
    x-=1
  elif x==2**(i+1)-1:
    if i!=0:
      c+=l[i-1]+1
    elif i==0:
      c+=1
    x=0
  elif x>2**(i+1)-1:
    if i!=0:
      c+=l[i-1]+1
    elif i==0:
      c+=1
    elif x==m[i]:
      x-=1
    x=x-(2**(i+1)-1)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
L=[]
x=m/n
for i in range(1,int(x+1)):
  if m%i==0:
    if i<=x:
      L.append(i)
    if m//i<=x:
      L.append(m//i)
print(max(L))

Fixed submission:
n,m=map(int,input().split())
L=[]
x=m/n
for i in range(1,min(int(x)+1,int(m**0.5)+1)):
  if m%i==0:
    if i<=x:
      L.append(i)
    if m//i<=x:
      L.append(m//i)
print(max(L))
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
d=0
for a in range(1,n+1):
 for b in range(k-a%k,n+1,k):
   for c in range(k-a%k,n+1,k):
    if (a+b)%k==0 and (b+c)%k==0 and (c+a)%k==0:d+=1
print(d)

Fixed submission:
n,k=map(int,input().split())
if k%2==0:
 if n%k<k/2:print((n//k)**3+(n//k)**3)
 else:print((n//k)**3+((n//k)+1)**3)
else:print((n//k)**3)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
d=0
for a in range(1,n+1):
 for b in range(1,n+1):
  for c in range(1,n+1):
   if (a+b)%k==0 and (b+c)%k==0 and (c+a)%k==0:d+=1
print(d)

Fixed submission:
n,k=map(int,input().split())
if k%2==0:
 if n%k<k/2:print((n//k)**3+(n//k)**3)
 else:print((n//k)**3+((n//k)+1)**3)
else:print((n//k)**3)
Buggy python submission (verdict: Runtime Error):
s=list(input())
k=int(input())
c=0
for i in range(len(s)):
 if int(s[i])!=1:
  if i<k:
   print(s[i])
   break
  else:
   print(1)
   break​

Fixed submission:
s=list(input())
k=int(input())
if list(set(s))==['1']:
 print(1)
else:
 for i in range(len(s)):
  if int(s[i])!=1:
   if i<k:
    print(s[i])
    break
   else:
    print(1)
    break
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
def lcm(x,y):
  return int(x*y/gcd(x,y))
n=int(input())
a=list(map(int,input().split()))
for i in range(1,len(a)):
  if i==1:g=lcm(a[0],a[1])
  else:g=lcm(g,a[i])
c=0
for j in range(len(a)):
  c+=(g-1)%a[j]
print(c)

Fixed submission:
input()
a=list(map(int,input().split()))
print(sum(a)-len(a))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  if p==0:
    c+=1
    while len(l)>2:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    if l[0]==0:
      p=l.pop(0)
      if len(l)>0:
        p=l.pop(0)
      else:
         break
    else:
      p=l.pop(0)
if p==0:c+=1
print(c)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
if len(l)==1 and l[n-2]==0:c+=1
if len(l)>1 and l[n-2]==0 and l[n-3]!=0:c+=1
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  else:
    c+=1
    while len(l)>1:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    while len(l)>0:
      if l[0]==0:
        p=l.pop(0)
      else:
        p=l.pop(0)
        break
print(c)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  if p==0:
    c+=1
    while len(l)>2:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    if l[0]==0:
      p=l.pop(0)
      if len(l)>0:
        p=l.pop(0)
      else:
         break
    else:
      p=l.pop(0)
print(c)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
if len(l)==1 and l[n-2]==0:c+=1
if len(l)>1 and l[n-2]==0 and l[n-3]!=0:c+=1
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  else:
    c+=1
    while len(l)>1:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    while len(l)>0:
      if l[0]==0:
        p=l.pop(0)
      else:
        p=l.pop(0)
        break
print(c)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  if p==0:
    c+=1
    while l[0]==0 and l[1]==0:
      p=l.pop(0)
      p=l.pop(0)
      c+=1
    if l[0]==0:
      p=l.pop(0)
      p=l.pop(0)
    else:
      p=l.pop(0)
print(c)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=0
l=[]
for i in range(1,n):
  l.append(a[i]-a[i-1])
if len(l)==1 and l[n-2]==0:c+=1
if len(l)>1 and l[n-2]==0 and l[n-3]!=0:c+=1
p=l.pop(0)
while len(l)!=0:
  if p!=0:
    p=l.pop(0)
  else:
    c+=1
    while len(l)>1:
      if l[0]==0 and l[1]==0:
        p=l.pop(0)
        p=l.pop(0)
        c+=1
      else:
        break
    while len(l)>0:
      if l[0]==0:
        p=l.pop(0)
      else:
        p=l.pop(0)
        break
print(c)
Buggy python submission (verdict: Runtime Error):
def cmb(n,r,mod):
    r=min(r,n-r)
    return g1[n]*g2[r]*g2[n-r]%mod

n,a,b,k=map(int,input().split())
m=998244353
count=0

g1=[1,1]
g2=[1,1]
inverse=[0,1]

for i in range(2,n+1):
  g1.append((g1[-1]*i)%m)
  inverse.append((-inverse[m%i]*(m//i))%m)
  g2.append((g2[-1]*inverse[-1])%m)

for i in range(n):
  if (k-a*i)%b==0 and (k-a*i)//b<=n:
    j=(k-a*i)//b
    count+=cmb(n,i,m)*cmb(n,j,m)
  count%=m
print(count)

Fixed submission:
def cmb(n,r,mod):
  if r<0 or r>n:
    return 0
  r=min(r,n-r)
  return g1[n]*g2[r]*g2[n-r]%mod

n,a,b,k=map(int,input().split())
m=998244353
count=0

g1=[1,1]
g2=[1,1]
inverse=[0,1]

for i in range(2,n+1):
  g1.append((g1[-1]*i)%m)
  inverse.append((-inverse[m%i]*(m//i))%m)
  g2.append((g2[-1]*inverse[-1])%m)

for j1 in range(n+1):
  if (k-a*j1)%b==0:
    j2=(k-a*j1)//b
    count+=cmb(n,j1,m)*cmb(n,j2,m)
  count%=m
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
l=n
for i in range(n):
  x=(s[0:i].count('W')+s[i+1:n].count('E'))
  if l>x:l=x
print(l)

Fixed submission:
n=int(input())
s=input()
c=s[1:n].count('E')
l=[]
l.append(c)
for i in range(1,n):
  if s[i-1:i+1]=='WW':c+=1
  elif s[i-1:i+1]=='EE':c-=1
  l.append(c)
print(min(l))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=list(input())
l=[]
for i in range(n):
  l.append(s[0:i].count('W')+s[i:n].count('E'))
print(min(l))

Fixed submission:
n=int(input())
s=input()
c=s[1:n].count('E')
l=[]
l.append(c)
for i in range(1,n):
  if s[i-1:i+1]=='WW':c+=1
  elif s[i-1:i+1]=='EE':c-=1
  l.append(c)
print(min(l))
Buggy python submission (verdict: Runtime Error):
x=int(input())
a=[]
for i in range(2,10):
  for j in range(1,32):
    if j**i<=x:a.append(j**i)
print(max(a))​

Fixed submission:
x=int(input())
a=[]
for i in range(2,10):
  for j in range(1,32):
    if j**i<=x:a.append(j**i)
print(max(a))
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n=int(input())
a=list(map(int,input().split()))
c=0
l=[0]
for i in range(n):
  l.append(l[i]+a[i])
L=collections.Counter(l)
for j in range(len(L)):
  x=L.most_common()[j][1]
  c+=int(x*(x-1)/2)
print(c)

Fixed submission:
import collections
n=int(input())
a=list(map(int,input().split()))
c=0
l=[0]
for i in range(n):
  l.append(l[i]+a[i])
L=collections.Counter(l)
for j in L.values():
  c+=int(j*(j-1)/2)
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n=int(input())
a=list(map(int,input().split()))
c=0
l=[0]
for i in range(n):
  l.append(l[i]+a[i])
l.sort()
L=collections.Counter(l)
for j in range(len(L)):
  x=L.most_common()[j][1]
  c+=int(x*(x-1)/2)
print(c)

Fixed submission:
import collections
n=int(input())
a=list(map(int,input().split()))
c=0
l=[0]
for i in range(n):
  l.append(l[i]+a[i])
L=collections.Counter(l)
for j in L.values():
  c+=int(j*(j-1)/2)
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
  for j in range(i,n):
    if sum(a[i:j+1])==0:c+=1
print(c)

Fixed submission:
import collections
n=int(input())
a=list(map(int,input().split()))
c=0
l=[0]
for i in range(n):
  l.append(l[i]+a[i])
L=collections.Counter(l)
for j in L.values():
  c+=int(j*(j-1)/2)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
print(0)
l=input()
L=0
if l=='Vacant':
  sys.exit()
print(n-1)
r=input()
R=n-1
if r=='Vacant':
  sys.exit()

while True:
  print((L+R)//2)
  x=input()
  X=(L+R)//2
  if x=='Vacant':
    sys.exit()
  if ((X-L)%2==1 and x==l) or ((X-L)%2==0 and x=!l):
    r=x;R=X
  else:
    l=x;L=X

Fixed submission:
import sys
n=int(input())
print(0)
l=input()
L=0
if l=='Vacant':
  sys.exit()
print(n-1)
r=input()
R=n-1
if r=='Vacant':
  sys.exit()

while True:
  print((L+R)//2)
  x=input()
  X=(L+R)//2
  if x=='Vacant':
    sys.exit()
  if ((X-L)%2==1 and x==l) or ((X-L)%2==0 and x!=l):
    r=x;R=X
  else:
    l=x;L=X

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n=int(input())
print(0)
l=input()
L=0
if l=='Vacant':
  sys.exit()
print(n-1)
r=input()
R=n-1
if r=='Vacant':
  sys.exit()

while True:
  print((L+R)//2)
  x=input()
  X=(L+R)//2
  if x=='Vacant':
    sys.exit()
  if (X-L)%2==1 and x==l or (X-L)%2==0 and x=!l:
    r=x;R=X
  else:
    l=x;L=X

Fixed submission:
import sys
n=int(input())
print(0)
l=input()
L=0
if l=='Vacant':
  sys.exit()
print(n-1)
r=input()
R=n-1
if r=='Vacant':
  sys.exit()

while True:
  print((L+R)//2)
  x=input()
  X=(L+R)//2
  if x=='Vacant':
    sys.exit()
  if ((X-L)%2==1 and x==l) or ((X-L)%2==0 and x!=l):
    r=x;R=X
  else:
    l=x;L=X
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n+1):
    if (y-10000*i-5000*j)%1000==0 and (y-10000*i-5000*j)//1000>=0 and i+j+(y-10000*i-5000*j)//1000==n:
      print(i,j,n-i-j)
      sys.exit()
print(-1,-1,-1)

Fixed submission:
n,y=map(int,input().split())
x=0
for i in range(n+1):
  if x==1:
    break
  for j in range(n-i+1):
    if y==i*10000+j*5000+(n-i-j)*1000:
      print(i,j,n-i-j)
      x=1
      break
if x==0:print(-1,-1,-1)
Buggy python submission (verdict: Runtime Error):
s=list(input())
l=[]
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    l.append(max(i+1,len(s)-i-1))
print(min(l))

Fixed submission:
s=list(input())
l=[len(s)]
for i in range(len(s)-1):
  if s[i]!=s[i+1]:
    l.append(max(i+1,len(s)-i-1))
print(min(l))
Buggy python submission (verdict: Runtime Error):
n,c=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
L=[[0 for i in range(10**5)] for i in range(c)]
for i in range(n):
  for j in range(l[i][0],l[i][1]+1):
    L[l[i][2]-1][j]=1
ans=[]
for i in range(10**5):
  ct=0
  for j in range(c):
    ct+=L[j][i]
    ans.append(ct)
print(max(ans))

Fixed submission:
n,c=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
L=[[0 for i in range(10**5+1)] for i in range(c)]
for i in range(n):
  for j in range(l[i][0],l[i][1]+1):
    L[l[i][2]-1][j]=1
ans=[]
for i in range(10**5+1):
  ct=0
  for j in range(c):
    ct+=L[j][i]
    ans.append(ct)
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
t=list(map(int,input().split()))
v=list(map(int,input().split()))
T=[0,t[0]]
for i in range(n-1):
  T.append(T[i+1]+t[i+1])
L=[[] for i in range(2*sum(t))]
for i in range(2*sum(t)):
  for j in range(n):
    if T[j]<=i/2<=T[j+1]:
      x=v[j]
    elif i/2<T[j]:
      x=v[j]+abs(i/2-T[j])
    else:
      x=v[j]+abs(i/2-T[j+1])
    L[i].append(x)
for i in range(2*sum(t)):
  L[i].append(i/2)
  L[i].append(sum(t)-i/2)

for i in range(2*sum(t)):
  L[i]=min(L[i])
ans=0
for i in range(2*sum(t)):
  if i==2*sum(t)-1:
    ans+=L[i]*0.25
  else:
    ans+=(L[i]+L[i+1])*0.25
print(ans)

Fixed submission:
n=int(input())
t=list(map(int,input().split()))
v=list(map(int,input().split()))
T=[0,t[0]]
for i in range(n-1):
  T.append(T[i+1]+t[i+1])
L=[[] for i in range(2*sum(t))]
for i in range(2*sum(t)):
  for j in range(n):
    if T[j]<=i/2<=T[j+1]:
      x=v[j]
    elif i/2<T[j]:
      x=v[j]+abs(i/2-T[j])
    else:
      x=v[j]+abs(i/2-T[j+1])
    L[i].append(x)
for i in range(2*sum(t)):
  L[i].append(i/2)
  L[i].append(sum(t)-i/2)

for i in range(2*sum(t)):
  L[i]=min(L[i])
ans=0
for i in range(2*sum(t)):
  if i==2*sum(t)-1:
    ans+=L[i]*0.25
  else:
    ans+=(L[i]+L[i+1])*0.25
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
x=[l[i][0] for i in range(n)]
x.sort()
y=[l[i][1] for i in range(n)]
y.sort()
ans=[]
for i1 in range(n):
  for i2 in range(n):
    for i3 in range(n):
      for i4 in range(n):
        ct=0
        for i5 in range(n):
          if min(x[i1],x[i2])<=l[i5][0]<=max(x[i1],x[i2]) and min(y[i3],y[i4])<=l[i5][1]<=max(y[i3],y[i4]):ct+=1
        if ct>=k:
          ans.append(abs(x[i1]-x[i2])*abs(y[i3]-y[i4]))
print(min(ans))

Fixed submission:
a,b,c=map(int,input().split())
if a==b:print(c)
elif a==c:print(b)
else:print(a)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
for x in range(h):
 for y in range(w):
  if l[x][y]=='.':
   c=0
   if x>0 and y>0:
    if l[x-1][y-1]=='#':c+=1
   if x>0:
    if l[x-1][y]=='#':c+=1
   if x>0 and y+1<h:
    if l[x-1][y+1]=='#':c+=1
   if y>0:
    if l[x][y-1]=='#':c+=1
   if y+1<h:
    if l[x][y+1]=='#':c+=1
   if x+1<h and y>0:
    if l[x+1][y-1]=='#':c+=1
   if x+1<h:
    if l[x+1][y]=='#':c+=1
   if x+1<h and y+1<h:
    if l[x+1][y+1]=='#':c+=1
   l[x][y]=str(c)
for j in range(h):
  l[j]=''.join(l[j])
  print(l[j])

Fixed submission:
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
for x in range(h):
 for y in range(w):
  if l[x][y]=='.':
   c=0
   if x>0 and y>0:
    if l[x-1][y-1]=='#':c+=1
   if x>0:
    if l[x-1][y]=='#':c+=1
   if x>0 and y+1<w:
    if l[x-1][y+1]=='#':c+=1
   if y>0:
    if l[x][y-1]=='#':c+=1
   if y+1<w:
    if l[x][y+1]=='#':c+=1
   if x+1<h and y>0:
    if l[x+1][y-1]=='#':c+=1
   if x+1<h:
    if l[x+1][y]=='#':c+=1
   if x+1<h and y+1<w:
    if l[x+1][y+1]=='#':c+=1
   l[x][y]=str(c)
for j in range(h):
  l[j]=''.join(l[j])
  print(l[j])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
x=0
d.sort()
t.sort()
for i in range(m):
  if t[i] in d:
    d.remove(t[i])
  else:
    x=1
    break
if x==0:print('YES')
else:print('NO')

Fixed submission:
from collections import Counter
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
D=Counter(d);T=Counter(t)
x=0
for i in list(set(t)):
  if D[i]<T[i]:
    x=1
    break
if x==0:print('YES')
else:print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
x=0
for i in range(m):
  if t[i] in d:
    d.remove(t[i])
  else:
    x=1
    break
if x==0:print('YES')
else:print('NO')

Fixed submission:
from collections import Counter
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
D=Counter(d);T=Counter(t)
x=0
for i in list(set(t)):
  if D[i]<T[i]:
    x=1
    break
if x==0:print('YES')
else:print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
x=0
for i in range(m):
  if t[i] in d:
    d.remove(t[i])
  else:
    x=1
    break
if x==0:print('YES')
else:print('NO')

Fixed submission:
from collections import Counter
n=int(input())
d=list(map(int,input().split()))
m=int(input())
t=list(map(int,input().split()))
D=Counter(d);T=Counter(t)
x=0
for i in list(set(t)):
  if D[i]<T[i]:
    x=1
    break
if x==0:print('YES')
else:print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=time.time()
for i in range(1,3501):
  for j in range(2,3501):
    p=4*i*j-n*(i+j)
    if p>0:
      q=n*i*j
      if q%p==0:
        print(i,j,q//p)
        exit()

Fixed submission:
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    p=4*i*j-n*i-n*j
    if p>0:
      if (n*i*j)%p==0:
        print(i,j,(n*i*j)//p)
        exit()

Fixed submission:
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    p=4*i*j-n*i-n*j
    if p>0:
      q=n*i*j
      if q%p==0:
        print(i,j,q//p)
        exit()

Fixed submission:
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    p=4*i*j-n*i-n*j
    if p>0:
      q=n*i*j
      if q%p==0:
        k=q//p
        break
  else:
    continue
  break
print(i,j,k)

Fixed submission:
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)

Fixed submission:
n=int(input())
for i in range(1,3501):
  for j in range(1,3501):
    if (4*i*j-n*i-n*j)!=0:
      if (n*i*j)%(4*i*j-n*i-n*j)==0 and (n*i*j)//(4*i*j-n*i-n*j)>0:
        k=(n*i*j)//(4*i*j-n*i-n*j)
        break
  else:
    continue
  break
print(i,j,k)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(n):
  x=int(input())
  if x not in a:a.append(x)
  else:a.remove(x)
print(len(a))

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  x=int(input())
  if x not in a:a.append(x)
  else:a.remove(x)
print(len(a))​

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
l=[]
for j in range(n):
  if a[j] not in l:l.append(a[j])
  else:l.remove(a[j])
print(len(l))

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n=int(input())
a=[int(input()) for i in range(n)]
c=collections.Counter(a)
ct=0
for j in range(len(set(a))):
  if c.most_common()[j][1]%2==1:
    ct+=1
print(ct)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n=int(input())
a=[int(input()) for i in range(n)]
c=collections.Counter(a)
l=[]
for j in range(len(set(a))):
  l.append(c.most_common()[j][1])
ct=0
for k in range(len(l)):
  if l[k]%2==1:ct+=1
print(ct)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n,m,r=map(int,input().split())
R=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

distance=[[99999999 for i in range(n)] for j in range(n)]
for i in range(n):
  distance[i][i]=0
for i in range(m):
  distance[l[i][0]-1][l[i][1]-1]=l[i][2]
  distance[l[i][1]-1][l[i][0]-1]=l[i][2]

for k in range(n):
  for i in range(n):
    for j in range(n):
      distance[i][j]=min(distance[i][j],distance[i][k]+distance[k][j])

ans=99999999
for i in itertools.permutations(R):
  L=list(i)
  ct=0
  for j in range(r-1):
    ct+=distance[L[j]-1][L[j+1]-1]
  ans=min(ans,ct)
print(ans)

Fixed submission:
import itertools
n,m,r=map(int,input().split())
R=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

distance=[[99999999 for i in range(n)] for j in range(n)]
for i in range(n):
  distance[i][i]=0
for i in range(m):
  distance[l[i][0]-1][l[i][1]-1]=l[i][2]
  distance[l[i][1]-1][l[i][0]-1]=l[i][2]

for k in range(n):
  for i in range(n):
    for j in range(n):
      distance[i][j]=min(distance[i][j],distance[i][k]+distance[k][j])

ans=99999999
for i in itertools.permutations(R):
  L=list(i)
  ct=0
  for j in range(r-1):
    ct+=distance[L[j]-1][L[j+1]-1]
  ans=min(ans,ct)
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
def lcm(a,b):
  return (a*b)//fractions.gcd(a,b)
n=int(input())
x=lcm(int(input()),int(input()))
for i in range(n-2):
  x=lcm(x,int(input()))
print(x)

Fixed submission:
import fractions
def lcm(a,b):
  return (a*b)//fractions.gcd(a,b)
n=int(input())
if n>1:
  x=lcm(int(input()),int(input()))
  for i in range(n-2):
    x=lcm(x,int(input()))
  print(x)
else:print(int(input()))