Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s="o"+input()+"o"
#o<<>>><>>o
ans=0
for i in range(0,len(s)-1):
  g=0
  for j in range(i,-1,-1):
    if s[j]=="<":
      g+=1
    else:
      break
  l=0
  for j in range(i+1,len(s)):
    if s[j]==">":
      l+=1
    else:
      break
  ans+=max(g,l)
print(ans)
  

Fixed submission:
s=input()
#<<>>><>>

g=[0 for i in range(len(s)+1)]
l=[0 for i in range(len(s)+1)]

for i in range(len(s)):
  if s[i]=="<":
    g[i+1]=g[i]+1

for i in range(len(s)-1,-1,-1):
  if s[i]==">":
    l[i]=l[i+1]+1
    
ans=0
for i in range(len(s)+1):
  ans+=max(g[i],l[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans="No"
for i in range(100):
  if n%i==0:
    ans="Yes"
    break
print(ans)

Fixed submission:
n=int(input())
ans="No"
for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      ans="Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=liat(map(int,input().split()))

ans=0
a=0
for i in range(n-1):
  if l[i]>=l[i+1]:
    a+=1
  else:
    ans=max(ans,a)
print(ans)

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

ans=0
a=0
for i in range(n-1):
  if l[i]>=l[i+1]:
    a+=1
  else:
    ans=max(ans,a)
    a=0
ans=max(ans,a)
print(ans)
Buggy python submission (verdict: Runtime Error):
#include<iostream>
using namespace std;
int main(){
  int k,x,a,b;
  scanf("%d %d",&k,&x);
  if(-1000000<x-k+1){
    a=x-k+1;
  }
  else{
    a=-1000000;
  }
  if(1000000>x+k-1){
    b=x+k-1;
  }
  else{
    b=1000000;
  }
  for(int i=a;i<b;i++){
  cout<<i<<" ";
  }
  cout<<b<<endl;
}

Fixed submission:
k,x=map(int,input().split())
xmin=max(-1000000,x-k+1)
xmax=min(1000000,x+k-1)
for i in range(xmin,xmax+1):
  print(i,end=" ")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,intpu().split())
print(max(0,c-(a-b)))

Fixed submission:
a,b,c=map(int,input().split())
print(max(0,c-(a-b)))
Buggy python submission (verdict: Runtime Error):
n,d=map(int,input().split())
x=[]
for _ in range(d):
  x+=[list(map(int,input().split()))]
ans=0
for i in range(d):
  for j in range(i+1,d):
    l=0
    for k in range(n):
      l+=(x[i][k]-x[j][k])**2
    l=l**0.5
    if l.is_integer():
      ans+=1
print(ans)

Fixed submission:
n,d=map(int,input().split())
x=[]
for _ in range(n):
  x+=[list(map(int,input().split()))]
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dist=0
    for k in range(d):
      dist+=(x[i][k]-x[j][k])**2
    dist=dist**0.5
    if dist.is_integer():
      ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,d=map(int,input().split())
x=[]
for _ in range(d):
  x+=[list(map(int,input().split()))]
ans=0
for i in range(d):
  for j in range(i+1,d):
    l=0
    for k in range(n):
      l+=(x[i][k]-x[j][k])**2
    if l==l**0.5**2:
      ans+=1
print(ans)

Fixed submission:
n,d=map(int,input().split())
x=[]
for _ in range(n):
  x+=[list(map(int,input().split()))]
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dist=0
    for k in range(d):
      dist+=(x[i][k]-x[j][k])**2
    dist=dist**0.5
    if dist.is_integer():
      ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
x=0
for i in range(n):
  x+=a[i]
#print(x)
m=[]
for i in range(n):
  m+=[(a[(i+1)%n]-a[i])*2]
#print(m)
for i in range(n):
  x-=m[2*i%n]*(n-i-1)
#print(x)
ans=[0 for _ in range(n)]
ans[0]=x//n
for i in range(1,n):
  ans[2*i%n]=ans[2*(i-1)%n]+m[2*(i-1)%n]
#print(ans)
s=""
for i in range(n-1):
  s+=str(ans[i])+" "
s+=str(ans[n-1])
print(s)

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

m=[]
for i in range(n):
  m+=[(a[(i+1)%n]-a[i])*2]
#print(x)
#print(m)

ans=[0 for _ in range(n)]
for i in range(1,n):
  ans[2*i%n]=+m[2*(i-1)%n]
for i in range(n-1):
  m[2*(i+1)%n]+=m[2*i%n]
#print(m)
for i in range(n):
  x+=a[i]
  x-=m[2*i%n]
#print(x)
ans[0]=x//n
for i in range(1,n):
  ans[2*i%n]+=ans[2*(i-1)%n]
#print(ans)
for i in range(n-1):
  print(ans[i],end=" ")
print(ans[n-1])
Buggy python submission (verdict: Runtime Error):
p,q,r=map(int,input().split())
print(sum(p,q,r)-max(p,q,r))

Fixed submission:
p=list(map(int,input().split()))
print(sum(p)-max(p))
Buggy python submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
for i in range(n-1):
  w[i+1]+=w[i]
ans=100000
for i in range(n-1):
  ans=min(ans,abs(w[i],w[n-1]-w[i]))
print(ans)

Fixed submission:
n=int(input())
w=list(map(int,input().split()))
for i in range(n-1):
  w[i+1]+=w[i]
ans=100000
for i in range(n-1):
  ans=min(ans,abs(w[i]-(w[n-1]-w[i])))
print(ans)

Buggy python submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int w[n];
  for(int i=0;i<n;i++)cin>>w[i];
  int s1=0,s2=0;
  for(int i=0;i<n;i++)s1+=w[i];
  int ans=abs(s1-s2);
  for(int i=0;i<n;i++){
    s1-=w[i];
    s2+=w[i];
    ans=min(ans,abs(s1-s2));
  }
  cout<<ans<<endl;
}

Fixed submission:
n=int(input())
w=list(map(int,input().split()))
for i in range(n-1):
  w[i+1]+=w[i]
ans=100000
for i in range(n-1):
  ans=min(ans,abs(w[i]-(w[n-1]-w[i])))
print(ans)
Buggy python submission (verdict: Runtime Error):
n,a,b,c,d=map(int,input().split())
a-=1
b-=1
c-=1
d-=1
s=input()
m=[0 for i in range(n)]
#a-c,b-d
#abcd
#abdc
for i in range(n):
    if s[i]=="#":
        m[i]=1
if c<d:#abcd
    if "##" in s[a:d]:
        print("NO")
            else:
print("YES")
else:#d<c abdc
    if "##" in s[a:c]:
        print("NO")
            else:
if "..." in s[b-1:d+1]:
    print("YES")
    else:
        print("NO")



Fixed submission:
n,a,b,c,d=map(int,input().split())
a-=1
b-=1
c-=1
d-=1
s=input()
m=[0 for i in range(n)]
#a-c,b-d
#abcd
#abdc
for i in range(n):
  if s[i]=="#":
    m[i]=1
if c<d:#abcd
  if "##" in s[a:d]:
    print("No")
  else:
    print("Yes")
else:#d<c abdc
  if "##" in s[a:c]:
    print("No")
  else:
    if "..." in s[b-1:d+2]:
      print("Yes")
    else:
      print("No")
Buggy python submission (verdict: Runtime Error):
n,k=input().split()
s=input()
ans=""
for i in range(n):
  if k+1==i:
    ans+=str.lower(s[i])
  else:
    ans+=s[i]
print(ans)

Fixed submission:
n,k=map(int,input().split())
s=input()
ans=""
for i in range(n):
  if k==i+1:
    ans+=str.lower(s[i])
  else:
    ans+=s[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0
for i in range(n+1):
  if r*i>n:
    break
  for j in range(n+1):
    if r*i+g*j>n:
      break
    if (n-r*i-g*j)%b==0:
      ans+=1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
m=[r,g,b]
m.sort(reverse=1)
r,g,b=m[0],m[1],m[2]
ans=0
if m==[1,1,1]:
  print((n+2)*(n+1)//2)
else:
  for i in range(n+1):
    if r*i>n:
      break
    for j in range(n+1):
      if r*i+g*j>n:
        break
      if (n-r*i-g*j)%b==0:
        ans+=1
  print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j+1:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])
    

Fixed submission:
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j+1:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
    break
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])
    

Fixed submission:
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j+1:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
    break
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(i,-1,-1):
    if not m[j]==j:
      continue
    #m[j]==j
    ans.append(j)
    m=m[:j]+m[j+1:]
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])
    

Fixed submission:
n=int(input())
m=list(map(int,input().split()))
ans=[]
for i in range(n):
  for j in range(n-1-i,-1,-1):
    if not m[j]==j+1:
      continue
    #m[j]==j
    ans.append(j+1)
    m=m[:j]+m[j+1:]
    break
if not len(m)==0:
  print(-1)
else:
  for i in range(n):
    print(ans[n-1-i])
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
ans=0
for i in range(n):
    for j in range(i,j):
        if s[j] in s[i:j]:
            break
        ans+=1
print(ans)

Fixed submission:
n=int(input())
l=input()
d=dict()
for a in l:
  if not a in d:
    d[a]=1
  else:
    d[a]+=1
ans=1
for a in d.values():
  ans*=a+1
print((ans-1)%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
c={}
d=[]
for i in range(n):
  a,b=map(int,input().split())
  if a not in c:
    c[a]=0
  c[a]+=b
  if a not in d:
    d.append(a)
  
d.sort()

ans=0
for i in range(n):
  if m > c[d[i]]:
    m-=c[d[i]]
    ans+=d[i]*c[d[i]]
  else:
    ans+=d[i]*m
    break
    
print(ans)

  

Fixed submission:
n,m=map(int,input().split())
c={}
d=[]
for i in range(n):
  a,b=map(int,input().split())
  if a not in c:
    c[a]=0
    d.append(a)
  c[a]+=b
  
d.sort()

ans=0
for i in range(n):
  if m > c[d[i]]:
    m-=c[d[i]]
    ans+=d[i]*c[d[i]]
  else:
    ans+=d[i]*m
    break
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect

A,B,Q=map(int,input().split())
inf = 10 ** 18
S = [-inf] + [int(input()) for _ in range(A)] + [inf]
T = [-inf] + [int(input()) for _ in range(B)] + [inf]

for q in range(Q):
    x = int(input())
    s_l = bisect.bisect_left(s,x)
    s_h = s_l + 1
    t_l = bisect.bisect_left(t,x)
    t_h = t_l + 1

    ans = inf
    for s in [S[s_l],S[s_h]]:
        for t in [T[t_l],T[t_h]]:
            d1 = abs(s-x)+abs(t-s)
            d2 = abs(t-x)+abs(s-t)
            ans = min(ans,d1,d2)
    
    print(ans)


Fixed submission:
import bisect

A,B,Q=map(int,input().split())
inf = 10 ** 18
S = [-inf] + [int(input()) for _ in range(A)] + [inf]
T = [-inf] + [int(input()) for _ in range(B)] + [inf]

for q in range(Q):
    x = int(input())
    s_h = bisect.bisect(S,x)
    s_l = s_h - 1
    t_h = bisect.bisect(T,x)
    t_l = t_h - 1

    ans = inf
    for s in [S[s_l],S[s_h]]:
        for t in [T[t_l],T[t_h]]:
            d1 = abs(s-x)+abs(t-s)
            d2 = abs(t-x)+abs(s-t)
            ans = min(ans,d1,d2)
    
    print(ans)

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

A,B,Q=map(int,input().split())
inf = 10 ** 18
S = [-inf] + [int(input()) for _ in range(A)] + [inf]
T = [-inf] + [int(input()) for _ in range(B)] + [inf]

for q in range(Q):
    x = int(input())
    s_l = bisect.bisect_left(s,x)
    s_h = s_l + 1
    t_l = bisect.bisect_left(t,x)
    t_h = t_l + 1

    ans = inf
    for s in [s_l,s_h]:
        for t in [t_l,t_h]:
            d1 = abs(s-x)+abs(t-s)
            d2 = abs(t-x)+abs(s-t)
            ans = min(ans,d1,d2)
    
    print(ans)


Fixed submission:
import bisect

A,B,Q=map(int,input().split())
inf = 10 ** 18
S = [-inf] + [int(input()) for _ in range(A)] + [inf]
T = [-inf] + [int(input()) for _ in range(B)] + [inf]

for q in range(Q):
    x = int(input())
    s_h = bisect.bisect(S,x)
    s_l = s_h - 1
    t_h = bisect.bisect(T,x)
    t_l = t_h - 1

    ans = inf
    for s in [S[s_l],S[s_h]]:
        for t in [T[t_l],T[t_h]]:
            d1 = abs(s-x)+abs(t-s)
            d2 = abs(t-x)+abs(s-t)
            ans = min(ans,d1,d2)
    
    print(ans)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
  k=list(map(int,input().split()))
  for j in range(1,k[0]):
    a[k[j]-1]=1
    
print(m.count(0))

Fixed submission:
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
  b=list(map(int,input().split()))
  for i in range(b[0]):
    a[b[i+1]-1]+=1
ans=0
for i in a:
  if i==n:
    ans+=1
print(ans)

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

Fixed submission:
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
  b=list(map(int,input().split()))
  for i in range(b[0]):
    a[b[i+1]-1]+=1
ans=0
for i in a:
  if i==n:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
nn=[2,5,5,4,5,6,3,7,6]
n,m=map(int,input().split())
a=input().split()
b=[]
for i in range(m):
  a[i]=int(a[i])
  
if 5 in a:
  if 2 in a:
    a.remove(2)
  if 3 in a:
    a.remove(3)
elif 3 in a:
  if 2 in a:
    a.remove(2)
if 9 in a:
  if 6 in a:
    a.remove(6)
    
a.sort(reverse=True)
for i in range(len(a)):
  b.append(nn[a[i]-1])
  
dp=[-10*18 for _ in range(n+1)]
dp[0]=0
for i in range(n):
  for j in range(len(b)):
    if i+b[j]>n:
      continue
    dp[i+b[j]]=max(dp[i+b[j]],dp[i]+1)
    
k=dp[n]
ans=""
for i in range(k):
  for j in range(len(b)):
    if dp[n-b[j]]==dp[n]-1:
      ans+=str(a[j])
      n-=b[j]
      break
      
print(ans)



Fixed submission:
nn=[2,5,5,4,5,6,3,7,6]
n,m=map(int,input().split())
a=input().split()
b=[]
for i in range(m):
  a[i]=int(a[i])
  
if 5 in a:
  if 2 in a:
    a.remove(2)
  if 3 in a:
    a.remove(3)
elif 3 in a:
  if 2 in a:
    a.remove(2)
if 9 in a:
  if 6 in a:
    a.remove(6)
    
a.sort(reverse=True)
for i in range(len(a)):
  b.append(nn[a[i]-1])
  
dp=[-10*18 for _ in range(n+1)]
dp[0]=0
for i in range(n):
  for j in range(len(b)):
    if i+b[j]>n:
      continue
    dp[i+b[j]]=max(dp[i+b[j]],dp[i]+1)
    
k=dp[n]
ans=""
for i in range(k):
  for j in range(len(b)):
    if n-b[j]<0:
      continue
    if dp[n-b[j]]==dp[n]-1:
      ans+=str(a[j])
      n-=b[j]
      break
      
print(ans)

Buggy python submission (verdict: Runtime Error):
nn=[[1,2],[7,3],[4,4],[5,5],[3,5],[2,5],[9,6],[6,6],[8,7]]
n,m=map(int,input().split())
a=input().split()
for i in range(m):
  a[i]=int(a[i])
b=[]
for i in range(9):
  if nn[i][0] in a:
    b.append(nn[i])
  
c=[b[0]]
del b[0]
for i in range(len(b)):
  t=0
  for j in range(len(c)):
    if b[i][1] == c[j][1]:
      t=1
      break
  if t==1:
    continue
  c.append(b[i])
  
t=n//c[0][1]
n-=c[0][1]*t
a=c[0]
del c[0]
for i in range(len(c)):
  c[i][1]-=a[1]

ans=""
while c[0][1] <= n:
  for i in range(len(c)):
    i=len(c)-1-i
    if c[i][1]<=n:
      ans+=str(c[i][0])
      n-=c[i][1]
      t-=1
      break
      
ans+=str(a[0])*t
print(ans)

Fixed submission:
nn=[2,5,5,4,5,6,3,7,6]
n,m=map(int,input().split())
a=input().split()
b=[]
for i in range(m):
  a[i]=int(a[i])
  
if 5 in a:
  if 2 in a:
    a.remove(2)
  if 3 in a:
    a.remove(3)
elif 3 in a:
  if 2 in a:
    a.remove(2)
if 9 in a:
  if 6 in a:
    a.remove(6)
    
a.sort(reverse=True)
for i in range(len(a)):
  b.append(nn[a[i]-1])
  
dp=[-10*18 for _ in range(n+1)]
dp[0]=0
for i in range(n):
  for j in range(len(b)):
    if i+b[j]>n:
      continue
    dp[i+b[j]]=max(dp[i+b[j]],dp[i]+1)
    
k=dp[n]
ans=""
for i in range(k):
  for j in range(len(b)):
    if n-b[j]<0:
      continue
    if dp[n-b[j]]==dp[n]-1:
      ans+=str(a[j])
      n-=b[j]
      break
      
print(ans)
Buggy python submission (verdict: Runtime Error):
l=int(input())
a=[]
for k in range(l):
    a.append(int(input()))
ans=9999
for i in range(l):
    for j in range(l):
        if i<j:
            for k in range(j-i+1):
                k+=i
                n=0
                m=0
                for t in range(k-i):
                    t+=i
                    if a[t] % 2 == 0:
                        n+=1
                    else:
                        m+=1
                for t in range(j-k+1):
                    t+=k
                    if a[t] % 2 == 0:
                        m+=1
                    else:
                        n+=1
                if ans>m:
                    ans=m
                if ans>n:
                    ans=n
print(ans)


Fixed submission:
n,k= map(int, input().split())
if n+1>=k*2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
n,k= map(int, input().split())
if n+1>2*k:
    print(YES)
else:
    print(NO)


Fixed submission:
n,k= map(int, input().split())
if n+1>=k*2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a1,b1=map(int,input().split())
a2,b3=map(int,input().split())
a2,b3=map(int,input().split())
m = [a1,b1,a2,b2,a3,b3]

n={1:0,2:0,3:0,4:0}
for x in m:
    n[x]+=1
    
t=0
for i in range(3):
    i+=1
    if n[i] != 1 and n[i] != 2:
        t=1
        
if t == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
a3,b3=map(int,input().split())
m = [a1,b1,a2,b2,a3,b3]

n={1:0,2:0,3:0,4:0}
for x in m:
    n[x]+=1
    
t=0
for i in range(4):
    i+=1
    if n[i] != 1 and n[i] != 2:
        t=1
        
if t == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for i in range(n)]
a=sun(l)
ans='Yes'
for i in l:
  if a-i<i:
    ans='No'
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
a=sum(l)
ans='Yes'
for i in l:
  if a-i<=i:
    ans='No'
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
if m==1:
  print(0)
else:
  x.sort()
  ans=x[m-1]-x[0]
  l=[]
  for i in range(m-1):
    l.append(x[i+1]-x[i])
  l.sort(reverse=1)
  for i in range(n-1):
    ans-=l[i]
  print(ans)

Fixed submission:
n,m=map(int,input().split())
x=list(map(int,input().split()))
if n>=m:
  n=m
if m==1:
  print(0)
else:
  x.sort()
  ans=x[m-1]-x[0]
  l=[]
  for i in range(m-1):
    l.append(x[i+1]-x[i])
  l.sort(reverse=1)
  for i in range(n-1):
    ans-=l[i]
  print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
ans=x[m-1]-x[0]
l=[]
for i in range(m-1):
  l.append(x[i+1]-x[i])
l.sort(reverse=1)
for i in range(n-1):
  ans-=l[i]
print(ans)

Fixed submission:
n,m=map(int,input().split())
x=list(map(int,input().split()))
if n>=m:
  n=m
if m==1:
  print(0)
else:
  x.sort()
  ans=x[m-1]-x[0]
  l=[]
  for i in range(m-1):
    l.append(x[i+1]-x[i])
  l.sort(reverse=1)
  for i in range(n-1):
    ans-=l[i]
  print(ans)
Buggy python submission (verdict: Runtime Error):
s=[int(input())]
i=0
while 1>0:
  if i%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+1)
    break
  i+=1


Fixed submission:
s=[int(input())]
i=0
while 1>0:
  if s[i]%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+2)
    break
  i+=1
  s+=[b]

Buggy python submission (verdict: Time Limit Exceeded):
s=[int(input())]
i=0
while 1>0:
  if i%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+1)
    break


Fixed submission:
s=[int(input())]
i=0
while 1>0:
  if s[i]%2>0:
    b=3*s[i]+1
  else:
    b=s[i]//2
  if b in s:
    print(i+2)
    break
  i+=1
  s+=[b]
Buggy python submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in range(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.rfind(n)
  if m==-1 or n==-1:
    continue
  if n-m>=len(m):
    ans=0
    break
print("YNEOS"[ans::2])

Fixed submission:
a="keyence"
s=input()
ans=1
for i in range(len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]==a:
      ans=0
print("YNEOS"[ans::2])

Buggy python submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in rangn(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.find(n)
  if m==-1 or n==-1:
    continue
  if n-m>=i:
    ans=0
    break
print("YNEOS"[ans::2])

Fixed submission:
a="keyence"
s=input()
ans=1
for i in range(len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]==a:
      ans=0
print("YNEOS"[ans::2])

Buggy python submission (verdict: Runtime Error):
a="keyence"
s=input()
ans=1
for i in rangn(7):
  m=a[:i]
  n=a[i:]
  m=s.find(m)
  n=s.find(n)
  if m==-1 or n==-1:
    continue
  if n-m>=i:
    ans=0
    break
print("YNeos"[ans::2])

Fixed submission:
a="keyence"
s=input()
ans=1
for i in range(len(s)):
  for j in range(i,len(s)):
    if s[:i]+s[j:]==a:
      ans=0
print("YNEOS"[ans::2])
Buggy python submission (verdict: Runtime Error):
print(input().conut('2'))

Fixed submission:
print(input().count('2'))
Buggy python submission (verdict: Runtime Error):
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(765-a[i:i+3])
  ans=min(ans,b)
print(ans)

Fixed submission:
a=input()
ans=999
for i in range(len(a)-2):
  b=abs(753-int(a[i:i+3]))
  ans=min(ans,b)
print(ans)
Buggy python submission (verdict: Runtime Error):
i=int(input);print(i()+i()if 1<i()else'Hello World')


Fixed submission:
if int(input())==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
i=int(input);print(i()+i()if1<i()else'Hello World')


Fixed submission:
if int(input())==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy python submission (verdict: Runtime Error):
if input()==1:
  print("Hello World")
else:
  a,b=input(),input();print(a+b)

Fixed submission:
if int(input())==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans=100000000
  print('TLE')
else:
  print(ans)


Fixed submission:
n,a=map(int,input().split())
ans=100000000
for i in range(n):
  c,t=map(int,input().split())
  if t<=a:
    ans=min(ans,c)
if ans==100000000:
  print('TLE')
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(map(int,input().split()))
d1=dict()
d2=dict()
for i in range(0,n,2):
  if i not in d1:
    d1[i]=1
  else:
    d1[i]+=1
for i in range(1,n,2):
  if i not in d2:
    d2[i]=1
  else:
    d2[i]+=1
dmk,dm,dmmk,dmm=[],0,[],0
for i in d1.keys():
  if dm<d1[i]:
    dmm=dm
    dmmk=dmk
    dm=d1[i]
    dmk=[i]
  elif d1==d1[i]:
    dmk+=[i]
  elif dmm<d1[i]:
    dmm=d1[i]
    dmmk=[i]
  elif dmm=d1[i]:
    dmmk+=[i]
d1=[len(dmk),len(dmmk)]
dmk,dm,dmmk,dmm=[],0,[],0
for i in d2.keys():
  if dm<d2[i]:
    dmm=dm
    dmmk=dmk
    dm=d2[i]
    dmk=[i]
  elif d2==d2[i]:
    dmk+=[i]
  elif dmm<d2[i]:
    dmm=d2[i]
    dmmk=[i]
  elif dmm=d2[i]:
    dmmk+=[i]
d2=[len(dmk),len(dmmk)]
if d1[0]>1 or d2[0]>1:
  print(n-d1[0]-d2[0])
else:
  print(n-max(d1[0]+d2[1],d1[1]+d2[0]))


Fixed submission:
n=int(input())
s=list(map(int,input().split()))
d1=dict()
d2=dict()
for i in range(0,n,2):
  if s[i] not in d1:
    d1[s[i]]=1
  else:
    d1[s[i]]+=1
for i in range(1,n,2):
  if s[i] not in d2:
    d2[s[i]]=1
  else:
    d2[s[i]]+=1
dmk,dm,dmmk,dmm=[],0,[],0
for i in d1.keys():
  if dm<d1[i]:
    dmm=dm
    dmmk=dmk
    dm=d1[i]
    dmk=[i]
  elif d1==d1[i]:
    dmk+=[i]
  elif dmm<d1[i]:
    dmm=d1[i]
    dmmk=[i]
  elif dmm==d1[i]:
    dmmk+=[i]
d1=[dm,dmk,dmm,dmmk]
dmk,dm,dmmk,dmm=[],0,[],0
for i in d2.keys():
  if dm<d2[i]:
    dmm=dm
    dmmk=dmk
    dm=d2[i]
    dmk=[i]
  elif d2==d2[i]:
    dmk+=[i]
  elif dmm<d2[i]:
    dmm=d2[i]
    dmmk=[i]
  elif dmm==d2[i]:
    dmmk+=[i]
d2=[dm,dmk,dmm,dmmk]
if len(d1[1])>1 or len(d2[1])>1 or d1[1]!=d2[1]:
  print(n-d1[0]-d2[0])
else:
  print(n-max(d1[0]+d2[2],d1[2]+d2[0]))
Buggy python submission (verdict: Runtime Error):
print(eval('+'.join(input().sort())+'*10'))


Fixed submission:
a,b,c=map(int,input().split());print(max(a,b,c)*9+a+b+c)