Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N , M = (int(a) for a in input().split())
stair = [1]
brake = []
for i in range(1 , M+1) :
    a = int(input())
    brake.append(a)

for i in range(1, N+1) :
    if i in brake :
        stair.append(0)
    elif i == 1 : 
        stair.append(1) 
    else : stair.append((stair[i-1] + stair[i-2]) % (10**9+7))
         
print(stair[N])





Fixed submission:
N , M = (int(a) for a in input().split())
stair = [1]*(N+1)
for i in range(1 , M+1) :
    a = int(input())
    stair[a] = 0
 
for i in range(2, N+1) :
    stair[i] *= (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])

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

N , M = (int(a) for a in input().split())
stair = [1]
brake = []
for i in range(1 , M+1) :
    a = int(input())
    brake.append(a)

for i in range(1, N+1) :
    if i in brake :
        stair.append(0)
    elif i == 1 : 
        stair.append(1) 
    else : stair.append((stair[i-1] + stair[i-2]) % (10**9+7))
         
print(stair[N])





Fixed submission:
N , M = (int(a) for a in input().split())
stair = [1]*(N+1)
for i in range(1 , M+1) :
    a = int(input())
    stair[a] = 0
 
for i in range(2, N+1) :
    stair[i] *= (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])

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

N , M = (int(a) for a in input().split())
stair = [0]*(N+1)
stair[0] = 1
brake = []
for i in range(1 , M+1) :
    a = int(input())
    brake.append(a)

for i in range(1, N+1) :
    if i in brake :
        stair[i] = 0
    elif i == 1 :
        stair[i] = 1
    else : stair[i] = (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])





Fixed submission:
N , M = (int(a) for a in input().split())
stair = [1]*(N+1)
for i in range(1 , M+1) :
    a = int(input())
    stair[a] = 0
 
for i in range(2, N+1) :
    stair[i] *= (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])

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

N , M = (int(a) for a in input().split())
stair = [0]*(N+1)
stair[0] = 1
brake = []
for i in range(1 , M+1) :
    a = int(input())
    brake.append(a)

for i in range(1, N+1) :
    if i in brake :
        stair[i] = 0
    elif i == 1 :
        stair[i] = 1
    else : stair[i] = (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])





Fixed submission:
N , M = (int(a) for a in input().split())
stair = [1]*(N+1)
for i in range(1 , M+1) :
    a = int(input())
    stair[a] = 0
 
for i in range(2, N+1) :
    stair[i] *= (stair[i-1] + stair[i-2]) % (10**9+7)
         
print(stair[N])
Buggy python submission (verdict: Runtime Error):
N , M = (int(a) for a in input().split())
A = list(map(int,input().split()))
BC = [[int(a) for a in input().split()] for l in range(M)]
A =sorted(A)
BC = sorted(BC , key = lambda x: - x[1])
x = 0

for i in range(N*M) :
    if A[i] < BC[x][1] :
        A[i] = BC[x][1]
    else : break
    BC[x][0] -= 1
    if BC [-1][0] == 0:
        break
    if BC[x][0] == 0 :
        x += 1

print(sum(A))





Fixed submission:
N , M = (int(a) for a in input().split())
A = list(map(int,input().split()))
BC = [[int(a) for a in input().split()] for l in range(M)]
A =sorted(A)
BC = sorted(BC , key = lambda x: - x[1])
s = 0

for i in range(N*M) :
    if A[i] < BC[s][1] :
        A[i] = BC[s][1]
    else : break
    BC[s][0] -= 1
    if BC [-1][0] == 0 or i == N-1 :
        break
    if BC[s][0] == 0 :
        s += 1

print(sum(A))
Buggy python submission (verdict: Runtime Error):
n,x,m = map(int,input().split())

def f(x,m):
    return x%m

ans = 0

for i in range(n):
    ans += x
    x = f(x**2,m)

print(ans)


Fixed submission:
a = input()
if(a[-1]=="s"):
    a+="es"
else:
    a+="s"
print (a)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import sys
import resource
sys.setrecursionlimit(10 ** 9)
#resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))

mm = {}

def popcorn(n):
    n = bin(n)
    return n.count("1")

def f(n):
    n%=popcorn(n)
    return n
    
def nf(n,count):
    if(n == 0):
        return count
    elif(n in mm):
        count += mm[n]-1
        return count
    else:
        n%=popcorn(n)
        return nf(n,count+1)


n = int(input())
a = input()
moto = int(a,2)
for i in range(n-1,0-1,-1):
    if(a[n-1-i] == "0"):
        k=moto+2**i
    else:
        k=moto-2**i
    mo = f(k)
    if(mo in mm):
        print(mm[mo])
        continue
    else:
        count = nf(mo,1)
        print(count)
        mm[mo]=count
        
    
    


Fixed submission:
# coding: utf-8
# Your code h
l,r,d=map(int,input().split())
ans=0
for i in range(l,r+1):
    ans += i%d == 0
    
print(ans)
Buggy python submission (verdict: Runtime Error):
l=list().split()
print(1+l.index("0"))


Fixed submission:
l=input().split()
print(1+l.index("0"))

Buggy python submission (verdict: Runtime Error):
l=list().split()
print(1+l.index("0"))

Fixed submission:
l=input().split()
print(1+l.index("0"))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
h=list(map(int,input().split()))
miti=[[0]*n for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    miti[a-1][b-1]=1
    miti[b-1][a-1]=1



def check(i):
    hi=h[i]
    for j in range(n):
        if miti[i][j]==1:
            if hi<=h[j]:
                return False
    return True





count=0
for i in range(n):
    if check(i):
        count+=1

print(count)


Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
miti=[[0] for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    miti[a].append(h[b])
    miti[b].append(h[a])


count=0
for i in range(n):
    if h[i] > max(miti[i]):
        count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
s={n}
while True:
  n=abs(n-k)
  if(n in s):
    break
  else:
    s.add(n)
print(min(s))

Fixed submission:
n,k=map(int,input().split())
n%=k
if(k==1):
  print(0)
  exit()
s={n}
while True:
  n=abs(n-k)
  if(n in s):
    break
  else:
    s.add(n)
print(min(s))
Buggy python submission (verdict: Runtime Error):
#文字列
s=list(input())
n=int(input())
for i in range(n):
    li = input().split()
    if(li[0]=="1"):
        s.reverse()
    else:
        if(li[1]=="1"):
            s.insert(0, li[2])
        else:
            s.append(li[2])

print("".join(s))


Fixed submission:
#C消費税
h,j = map(int,input().split())
s=int(h*(25/2))
while True:
    hh=int(s*(2/25))
    jj=int(s/10)
    if(hh==h and jj==j):
        print(s)
        exit()
    if(hh>h and jj>j):
        print(-1)
        exit()
    s+=1
Buggy python submission (verdict: Runtime Error):
n,m= map(int,input().split())
check=[-1]*n
for i in range(m):
    s,c=map(int,input().split())
    s-=1
    if(check[s]!=-1 and check[s]!=c):
        print(-1)
        exit()
    check[s]=c
#print(check)
if(check[0]==0):
    if(n==1):
      print(0)
    else:
      print(-1)
    exit()
elif(check[0]==-1):
    check[0]=1

for i in range(n):
    if(check[i]==-1):
        check[i]=0
    print(check[i],end="")

    


Fixed submission:
import math
print(math.ceil(int(input())/2))
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
print(int(x*y/gcd(x,y)))


Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
print(x*y//gcd(x,y))


Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))

Buggy python submission (verdict: Runtime Error):

x,y = map(int,input().split())
import math
print(int((x * y) / math.gcd(x, y)))


Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))

Buggy python submission (verdict: Runtime Error):
import math
li = input().split()	
x=int(li[0])
y=int(li[1])
print((x * y) // math.gcd(x, y))


Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))

Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
print((x * y) // math.gcd(x, y))


Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))

Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
print(math.gcd(x, y))

Fixed submission:
import fractions
x,y = map(int,input().split())
print(x*y//fractions.gcd(x,y))
Buggy python submission (verdict: Runtime Error):
N = int(input())
data = []
sum = 0
x = 0
y = 1
ss=[0,0,2,4,18,96,600,4320,35280]
for i in range(N):
    data.append( list(map(int,input().split())))
for i in range(N -1):
    for j in range(N - 1):
        if(j+1+i==N):
            break
        sum+=((data[i][x]-data[j+1+i][x])**2+(data[i][y]-data[j+1+i][y])**2)**0.5

print(sum*ss[N]/N)


Fixed submission:
r = int(input())
print(r**2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  print(str(a.index(i+1)+1),end=" ")

Fixed submission:
n=int(input())
if(n%2==0):
  print(0.5)
else:
  print((n-int(n/2))/n)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
A= []
for i in range(n):
  A.append(a.index(i+1))
for i in range(n):
  print(A[i]+1, end=" ")

Fixed submission:
n=int(input())
if(n%2==0):
  print(0.5)
else:
  print((n-int(n/2))/n)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
A= []
for i in range(n):
  A.append(a.index(i+1))
for i in range(n):
  print(A[i]+1, end=" ")

Fixed submission:
n=int(input())
if(n%2==0):
  print(0.5)
else:
  print((n-int(n/2))/n)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
A= []
for i in range(n):
  A.append(a.index(i+1))
for i in range(n):
  print(A[i]+1, end=" ")

Fixed submission:
n=int(input())
if(n%2==0):
  print(0.5)
else:
  print((n-int(n/2))/n)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
for i in range(2*a-1):
  print(b-a+1,end="")

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

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),sprit())
print(max(a+b,a-b,a*b))

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

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
print(max(a+b,a-b,a*b))

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
for i in range(2*a-1):
  print(b-a+1+i,end=" ")

Fixed submission:
a,b=map(int,input().split())
for i in range(2*a-1):
  print(b-a+1+i,end=" ")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
for i in range(2*a-1):
  print(b-a+1,end="")

Fixed submission:
a,b=map(int,input().split())
for i in range(2*a-1):
  print(b-a+1+i,end=" ")
Buggy python submission (verdict: Runtime Error):
N=int(input())
all=0
a=5
while(a>0):
  if(10**a>N):
    a-=1
    continue
  if(a%2==1):
    all+=9*10**(a-1)
    a-=1
    continue
  else:
    all+=N+1-10**a
  
  a-=1


Fixed submission:
a,b,c=map(int,input().split())
if(c-a+b > 0):
  print(c-a+b)
else:
  print(0)

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

Fixed submission:
a,b,c=map(int,input().split())
if(c-a+b > 0):
  print(c-a+b)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        num_list[j]=0;
        print(max(num_list))
    else:
        print(m);


Fixed submission:
a=int(input());
print(3*a**2);

Buggy python submission (verdict: Runtime Error):
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        num_list[j]=0;
        print(max(num_list))
    print(m);


Fixed submission:
a=int(input());
print(3*a**2);

Buggy python submission (verdict: Runtime Error):
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        print(max(num_list))
    print(m);


Fixed submission:
a=int(input());
print(3*a**2);

Buggy python submission (verdict: Runtime Error):
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        print(m=max(num_list))
    print(m);


Fixed submission:
a=int(input());
print(3*a**2);
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
for j in range(n):
    m=num_list[j];
    num_list[j]=0;
    print(max(num_list));
    num_list[j]=m;


Fixed submission:
n=int(input())
num_list=[]
top1=0
top2=0
for i in range(n):
    num_list.append(int(input()))
    if top1<num_list[i]:
        top1=num_list[i]
    elif top2<num_list[i]:
        top2=num_list[i]
for j in range(n):
    if num_list[j]==top1:
        print(top2)
    else:
        print(top1)
Buggy python submission (verdict: Runtime Error):
s = input()
if l[-1] == 's':
    s += 'es'
else:
    s += 's'

Fixed submission:
s = input()
l = []
for i in s:
  l.append(i)
if l[-1] == 's':
    l.append('es')
    print("".join(j for j in l))
else:
    l.append('s')
    print("".join(j for j in l))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())
print(a+b//2)

Fixed submission:
a,b,c = map(int,input().split())
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p=[int,input() for i in range(n)]
print(sum(p)-max(p)//2)

Fixed submission:
n = int(input())
p=[int(input()) for i in range(n)]
print(sum(p)-max(p)//2)
Buggy python submission (verdict: Runtime Error):
x = input()
if x in 753:
  print("YES")
else:
  print("NO")

Fixed submission:
x = input()
if x in "753":
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a<=x and x<=a+b:
  print("YES")
else:
  print("NO")

Fixed submission:
a,b,x = map(int,input().split())
print("YES" if a<=x<=a+b else "NO")
Buggy python submission (verdict: Runtime Error):
s = input
print("Yes" if len(set(s)) else "No")

Fixed submission:
s = input()
print("Yes" if len(set(s))==3 else "No")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())
if a+b>c:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c = map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())
print("Yes" a+b>=c else"No")

Fixed submission:
a,b,c = map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print("Yes" a+b>=c else "NO")

Fixed submission:
a,b,c = map(int,input().split())
if a+b>=c:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = input()[0]
b = input()[1]
c = inpur()[2]
print(a+b+c)

Fixed submission:
a = input()[0]
b = input()[1]
c = input()[2]
print(a+b+c)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print("Left" a+b>c+d else "Balanced"a+b==c+d else "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 = int(input().split())
print(-(-a+b//2))

Fixed submission:
a,b = map(int,input().split())
print(-(-(a+b)//2))
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print("Yes" if a==b==c or b==c==d else "No")

Fixed submission:
a,b,c,d, = input()
print("Yes" if a==b==c or b==c==d else "No")
Buggy python submission (verdict: Runtime Error):
s = input()
i = input()
print("YES" if s==t[::-1] else "NO")

Fixed submission:
s = input()
t = input()
print("YES" if s==t[::-1] else "NO")
Buggy python submission (verdict: Runtime Error):
a,b,c = int(input().split())
if a==b:
  print(c)
elif b==c:
  print(a)
else:
  print(b)

Fixed submission:
a,b,c = map(int,input().split())
print(a if b==c else b if a==c else c)

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())
if a==b:
  print(c)
elif b==c:
  print(a)
else:
  print(b)
  

Fixed submission:
a,b,c = map(int,input().split())
print(a if b==c else b if a==c else c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n in "9":
  print("Yes")
else:
  print("No")

Fixed submission:
n = input()
print("Yes" if "9" in n else "No")

Buggy python submission (verdict: Runtime Error):
n = input()
if 9 in n:
  print("Yes")
else:
  print("No")
    

Fixed submission:
n = input()
print("Yes" if "9" in n else "No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
if '9' in n :
  print('Yes')
else:
  print('No')

Fixed submission:
n = input()
print("Yes" if "9" in n else "No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
if '9' in n:
  print('Yes')
else:
  print('No')
  

Fixed submission:
n = input()
print("Yes" if "9" in n else "No")
Buggy python submission (verdict: Runtime Error):
n,m=int(input().split())
print((n-1)*(m-1))

Fixed submission:
n,m = map(int,input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(min(a+b))


Fixed submission:
a,b,c = sorted(map(int,input().split()))
print(a+b)

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(min(a+b))

Fixed submission:
a,b,c = sorted(map(int,input().split()))
print(a+b)

Buggy python submission (verdict: Runtime Error):
a,b,c = sorted(map(in,input().split()))
print(a+b)
               

Fixed submission:
a,b,c = sorted(map(int,input().split()))
print(a+b)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input())
if c>=a and c<=b:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c = map(int,input().split())
print("Yes" if a<=c<=b else "No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a >b:
  print("GREATER")
elif a <b:
  print("LESS")
elif a==b:
  print("EQUAL")

Fixed submission:
a = int(input())
b = int(input())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(math.factorial(n)%(10**9+7)

Fixed submission:
import math
n = int(input())
print(math.factorial(n)%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(math.factorial(n)%(10**9+7)

Fixed submission:
import math
n = int(input())
print(math.factorial(n)%(10**9+7))
Buggy python submission (verdict: Runtime Error):
c = int(input())
print("vowel" if c in "aiueo" else "consonant")


Fixed submission:
c = input()
if c in 'aiueo':
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd
N = int(input())
ans = 0
for i in range(1,N+1):
  for k in range(1,N+1):
    for l in range(1,N+1):
      if i == k and k == l:
        tmp = i
      elif i==k:
        tmp = gcd(k,l)
      elif k==l:
        tmp = gcd(l,i)
      elif l==i:
        tmp = gcd(i,k)

      else:
        a = l 
        b = k
        c = i
        d = gcd(a,b)
        e = gcd(b,c)
        tmp = gcd(d,e)
      ans += tmp

print(ans)


Fixed submission:
from math import gcd
N = int(input())
ans = 0
for i in range(1,N+1):
  for j in range(1,N+1):
    for k in range(1,N+1):
      ans += gcd(gcd(i,j),k)

print(ans)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
N = int(input())
ans = 0
for i in range(N+1):
  for k in range(N+1):
    for l in range(N+1):
      ans += gcd(gcd(i,j),k)

print(ans)


Fixed submission:
from math import gcd
N = int(input())
ans = 0
for i in range(1,N+1):
  for j in range(1,N+1):
    for k in range(1,N+1):
      ans += gcd(gcd(i,j),k)

print(ans)
Buggy python submission (verdict: Runtime Error):
print(min(set(map(chr, range(97, 123))) - set(input())) or "None")

Fixed submission:
print(min(set(map(chr, range(97, 123))) - set(input()) or ["None"]))

Buggy python submission (verdict: Runtime Error):
print(min(set(map(chr, range(97, 123))) - set(input())) or None)

Fixed submission:
print(min(set(map(chr, range(97, 123))) - set(input()) or ["None"]))

Buggy python submission (verdict: Runtime Error):
print(min(set(map(chr, range(97, 123))) - set(input())))

Fixed submission:
print(min(set(map(chr, range(97, 123))) - set(input()) or ["None"]))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
rows = int(input())
x = [int(i) for i in input().split()]
p = 1
for i in x:
  p=p*i
if p>1000000000000000000:
  print(-1)
else:
  print(p)

Fixed submission:
import sys
N=int(input())
A=[int(i) for i in input().split()]
p=1
for i in A:
  if i==0:
    print(0)
    sys.exit()
for i in A:
  p=p*i
  if p>1000000000000000000:
    print(-1)
    sys.exit()
print(p)
Buggy python submission (verdict: Runtime Error):

N = int(input())
cnt = 0 
for a in range(1,N//2+1):
    for b in range(a,N):
        if N - a * b > 0:
            if a == b:
                cnt += 1
            else:
                cnt += 2
print(cnt)

Fixed submission:
s = input()

if s[-1] == 's':
    print(s+'es')
else:
    print(s+'s')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
out = 0
ls = []
RGB = ['R','G','B']
for i in RGB:
    ls.append([j for j, x in enumerate(S) if x == i])


# flg = [[[0 for i in range(N)] for j in range(N)] for k in range(N)]
for i in ls[0]:
    for j in ls[1]:
        for k in ls[2]:
            tmp = [i,j,k]
            tmp.sort()
            [l,m,n] = tmp
            if m-l != n-m:
                out += 1

print(out)


Fixed submission:
N = int(input())
S = input()
r,g,b = S.count('R'),S.count('G'),S.count('B')
#rgbでr,g,bがすべて異なる組み合わせ数
total = r*g*b
# そこからj-i=k-jの組み合わせを引く
for i in range(0,N-2):
    for j in range(i+1,N-1):
        k = 2*j-i
        if k >= N: break;
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            total-=1
# flg = [[[0 for i in range(N)] for j in range(N)] for k in range(N)]

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
out = 0
for i in range(0,N):
    for j in range(i,N):
        for k in range(j,N):
            if S[i] != S[j] and S[j] != S[k] and S[i] != S[k]:
                if j-i != k-j:
                    out+=1;

print(out)


Fixed submission:
N = int(input())
S = input()
r,g,b = S.count('R'),S.count('G'),S.count('B')
#rgbでr,g,bがすべて異なる組み合わせ数
total = r*g*b
# そこからj-i=k-jの組み合わせを引く
for i in range(0,N-2):
    for j in range(i+1,N-1):
        k = 2*j-i
        if k >= N: break;
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            total-=1
# flg = [[[0 for i in range(N)] for j in range(N)] for k in range(N)]

print(total)
Buggy python submission (verdict: Runtime Error):

N,W = map(int,input().split())
w,v = [0 for _ in range(N)],[0 for _ in range(N)]

for i in range(N):
    w[i],v[i] = map(int,input().split())

dp = [[0 for _ in range(110)] for _ in range(100100)]

for i in range(N):
    for sum_w in range(0,W+1):
        if sum_w - w[i] >= 0:
            dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w - w[i]] + v[i])

        dp[i+1][sum_w] = max(dp[i+1][sum_w], dp[i][sum_w])

#dp[i]][sum_w]
print(dp[N][W])

Fixed submission:
N,W = map(int,input().split())
w,v = [0 for _ in range(N)], [0 for _ in range(N)]
for i in range(N):
    w[i],v[i] = map(int,input().split())
# dp[i][w] = [合計重さ,重さw で得られる最大の価値v]
dp = [[0 for _ in range(W+1)] for i in range(N+1)]

for i in range(N):
    for sum_w in range(W+1):
        if sum_w - w[i] >= 0:
            dp[i+1][sum_w] = max(dp[i][sum_w], dp[i][sum_w - w[i]] + v[i])
        dp[i+1][sum_w] = max(dp[i+1][sum_w],dp[i][sum_w])

# for i in dp:
#     print(i)
print(dp[N][W])