Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
e = [0] * (N + 1)
for i in range(2, N + 1):
    cur = i

for j in range(2, i + 1):
    while cur % j == 0:
        e[j] += 1
        cur //= j


def num(m):  # e の要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m - 1, e)))


print(
    num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) *
    (num(5) - 1) * (num(3) - 2) // 2)


Fixed submission:
N = int(input())
e = [0] * (N + 1)

for i in range(2, N + 1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j


def num(m):  # e の要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m - 1, e)))


print(
    num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) *
    (num(5) - 1) * (num(3) - 2) // 2)
Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if c1[0][0] != c2[0][0]:
    print(n - c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))


Fixed submission:
from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if len(set(v)) == 1:
    print(len(v) // 2)
elif c1[0][0] != c2[0][0]:
    print(n - c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))

Buggy python submission (verdict: Runtime Error):
from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if c1[0][0] != c2[0][0]:
    print(n=c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))


Fixed submission:
from collections import Counter

n = int(input())
v = input().split()

v1 = v[::2]
v2 = v[1::2]
c1 = Counter(v1).most_common(2)
c2 = Counter(v2).most_common(2)

if len(set(v)) == 1:
    print(len(v) // 2)
elif c1[0][0] != c2[0][0]:
    print(n - c1[0][1] - c2[0][1])
else:
    print(min(n - c1[0][1] - c2[1][1], n - c1[1][1] - c2[0][1]))
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = []

for _ in range(h):
    a.append = list(map(int, input().split()))

ans = []

for i in range(h):
    for j in range(w - 1):
        if a[i][j] % 2 == 1:
            ans.append([i + 1, j + 1, i + 1, j + 2])
            a[i][j + 1] += 1

for i in range(h - 1):
    if a[i][w - 1] % 2 == 1:
        ans.append([i + 1, w, i + 2, w])
        a[i + 1][w - 1] += 1

print(len(ans))
for ans in ans:
    print(*ans)


Fixed submission:
h, w = map(int, input().split())
a = []

for _ in range(h):
    a.append(list(map(int, input().split())))

ans = []

for i in range(h):
    for j in range(w - 1):
        if a[i][j] % 2 == 1:
            ans.append([i + 1, j + 1, i + 1, j + 2])
            a[i][j + 1] += 1

for i in range(h - 1):
    if a[i][w - 1] % 2 == 1:
        ans.append([i + 1, w, i + 2, w])
        a[i + 1][w - 1] += 1

print(len(ans))
for ans in ans:
    print(*ans)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

c = 0
for si in s:
    if si == "1":
        c += 0
    else:
        a = si
        break

print("1" if k - c <= 0 else a)


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

c = 0
a = 1
for si in s:
    if si == "1":
        c += 1
    else:
        a = si
        break

print("1" if k - c <= 0 else a)
Buggy python submission (verdict: Runtime Error):
from statistics import mode

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

aa = list(map(lambda e: e[1] - (e[0] + 1), enumerate(a)))
minb = mode(aa)
ans = sum(map(lambda ea: abs(ea - minb), aa))

print(ans)

Fixed submission:
from statistics import median

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

aa = list(map(lambda e: e[1] - (e[0] + 1), enumerate(a)))
minb = median(aa)


ans = int(sum(map(lambda ea: abs(ea - minb), aa)))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())#整数
A = list(map(int, input().split()))#配列Int型

ans = 0

for i in range(N):
    for j in range(i + 1):
        if A[i] > A[j]:
            ans = A[i] - A[j]
            A[j] += ans
print(ans)

Fixed submission:
N = int(input())#整数
A = list(map(int, input().split()))#配列Int型

ans = 0
max_val = A[0]

for i in range(1, N):
    if max_val > A[i]:
        ans += max_val - A[i]
    else:
        max_val = A[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
vi = 0
j = 0
for s in input():
    j += 1

    if s == "R":
        i += 1
    if j != 3 and i > 0 and s == "S":
        i -= 1

print(i)

Fixed submission:
i = 0
j = 0
k = 0

w = ""
for s in input():
    j += 1

    if s == "S":
        k += 1

    if s == "S" and i > 0 and j == 2 and w != "R":
        i -= 1

    if s == "R" and (w == "R" or w == ""):
        i += 1
    elif s == "R" and w != s:
        i += 1    
    
    if w == "S":
        i = 1
    
    w = s

if k == 3:
    i = 0

print(i)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
A = 7 % K 
if K % 2 == 0:
    print(-1)
    exit()
for i in range(1, K + 1):
    if A % K == 0:
        print(i)
        break
    A = 10 * A + 7


Fixed submission:
K = int(input())
ans = -1
N = 7
for i in range(K):
    if N % K == 0:
        ans = i+1
        break
    N = (N*10+7) % K
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
A = 7 % K 

if K % 2 == 0:
    print(-1)
    exit()

for i in range(1, K + 1):
    if A % K == 0:
        print(i)
        exit()
    A = 10 * A + 7


Fixed submission:
K = int(input())
ans = -1
N = 7
for i in range(K):
    if N % K == 0:
        ans = i+1
        break
    N = (N*10+7) % K
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

K = int(input())
A = 7 % K 

for i in range(1, K + 1):
    if A % K == 0:
        print(i)
        exit()
    A = 10 * A + 7
print(-1)

Fixed submission:
K = int(input())
ans = -1
N = 7
for i in range(K):
    if N % K == 0:
        ans = i+1
        break
    N = (N*10+7) % K
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])

Fixed submission:
n=int(input())
m=int(n**0.5)
li=[0]*(10**4)
c=0
for i in range(1,m):
  for j in range(1,m):
    for k in range(1,m):
      if i*i+j*j+k*k+i*j+k*j+k*i<=n:
        li[i*i+j*j+k*k+i*j+k*j+k*i-1]+=1
for i in range(n):
  print(li[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=1
for i in a:
  b*=i
if b>10**18:
  print(-1)
else:
  print(b)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
if 0 in a:
  print(0)
  exit()
t=1
for i in a:
  t*=i
  if t>10**18:
    print("-1")
    exit()
print(t)
Buggy python submission (verdict: Runtime Error):
t=input()
n=len(t)
s=""
for i in range(n):
  if p[i]=="P":
    s+="P"
  else:
    s+="D"
print(s)

Fixed submission:
t=input()
n=len(t)
s=""
for i in range(n):
  if t[i]=="P":
    s+="P"
  else:
    s+="D"
print(s)
Buggy python submission (verdict: Runtime Error):
n=input()
if "7" in s:
  print("Yes")
else:
  print("No")

Fixed submission:
n=input()
if "7" in n:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for j in range(1,n-1):
  for i in range(j):
    for k in range(j+1,n):
      if j-i==k-j:
        continue
      if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
s=input()
r,g,b=0,0,0
for i in range(n):
    if s[i]=="R":
        r+=1
    elif s[i]=="G":
        g+=1
    else:
        b+=1
chohuku=0
double=0
for i in range(1,n-1):
    for j in range(1,min(i+1,n-i)):
        chohuku+=1
        k=j+i
        l=i-j
        if s[i]!=s[k] and s[i]!=s[l] and s[l]!=s[k]:
            double+=1
ans=r*g*b-double
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=0
for j in range(1,n-1):
  for i in range(j):
    for k in range(j+1,n):
      if j-i==k-j:
        continue
      if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
s=input()
r,g,b=0,0,0
for i in range(n):
    if s[i]=="R":
        r+=1
    elif s[i]=="G":
        g+=1
    else:
        b+=1
chohuku=0
double=0
for i in range(1,n-1):
    for j in range(1,min(i+1,n-i)):
        chohuku+=1
        k=j+i
        l=i-j
        if s[i]!=s[k] and s[i]!=s[l] and s[l]!=s[k]:
            double+=1
ans=r*g*b-double
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
N=[n]
import collections
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors+[n]
t=make_divisors(n)+make_divisors(n-1)
ans=0
for k in t:
  n=N[0]
  while n>=k:
    if n%k==0:
      n//=k
    else:
      n-=k
  if n==1:
    ans+=1
print(ans)

Fixed submission:
n=int(input())
N=[n]
import collections
def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a
t=prime_factorize(n-1) # n-1の素因数
c = collections.Counter(t)
w=1
for i in c.values():
  w *= 1+i
w-=1
#print(w)
# wはn-1の約数の個数（1以外）

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors
t=make_divisors(n)+[n]

for i in t:
  n=N[0]
  while n%i==0:
    n//=i
  if n%i==1:
    w+=1
print(w)

Buggy python submission (verdict: Runtime Error):
n=int(input())
N=[n]
import collections
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors+[n]
t=make_divisors(n)+make_divisor(n-1)
ans=0
for k in t:
  n=N[0]
  while n>=k:
    if n%k==0:
      n//=k
    else:
      n-=k
  if n==1:
    ans+=1
print(ans)

Fixed submission:
n=int(input())
N=[n]
import collections
def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a
t=prime_factorize(n-1) # n-1の素因数
c = collections.Counter(t)
w=1
for i in c.values():
  w *= 1+i
w-=1
#print(w)
# wはn-1の約数の個数（1以外）

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0 and i!=1:
      divisors.append(i)
      if i != n // i and n//i!=1:
        divisors.append(n//i)
  return divisors
t=make_divisors(n)+[n]

for i in t:
  n=N[0]
  while n%i==0:
    n//=i
  if n%i==1:
    w+=1
print(w)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int,input().split())
li=[0]*n
for i in range(1,n+1):
  for j in range(1,n+1):
    d=min(abs(i-j),abs(i-x)+abs(j-y)+1,1+abs(i-y)+abs(j-x))
    li[d]+=1
for k in range(1,n):
  print(li[k]//2)

Fixed submission:
n,x,y=map(int,input().split())
li=[0]*n
for i in range(1,n+1):
  for j in range(1,n+1):
    d=min(abs(i-j),abs(i-x)+abs(j-y)+1,1+abs(i-y)+abs(j-x))
    li[d]+=1
for k in range(1,n):
  print(li[k]//2)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h%2==1 and w%2==1:
  a1=((h+1)//2)*(w+1)//2
  a2=(h//2)*(w//2)
  print(a1+a2)
else:
  print((h*w)//2)


Fixed submission:
k=int(input())
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
n=len(s)
if n%2==1:
  print("No")
  exit()
while 1==1:
  if s[:2]=="hi":
    s=s[2:]
  elif len(s)==0:
    print("Yes")
    exit()
  else:
    print("No")

Fixed submission:
s=input()
n=len(s)
if n%2==1:
  print("No")
  exit()
while 1==1:
  if s[:2]=="hi":
    s=s[2:]
  elif len(s)==0:
    print("Yes")
    exit()
  else:
    print("No")
    exit()
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
sc=[]
for i in range(m):
  q=list(map(int,input().split()))
  if q not in sc:
    sc.append(q)
slist=[i[0] for i in sc]
if len(slist)!=len(set(slist)):
  print("-1")
  exit()
if n!=1 and [1,0] in sc:
  print(-1)
  exit()
if n==1 and sc == [[1,0]]:
  print(0)
  exit()

sc.sort()
num=""
k=0
sc.append(n+1)
for i in range(1,n+1):
  if sc[k][0]==i:
    num += str(sc[k][1])
    k+=1
  else:
    if i==1:
      num+="1"
    else:
      num += "0"
print(int(num))

Fixed submission:
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
# 全探索
if n==1:
  for i in range(10):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
elif n==2:
  for i in range(10,100):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
else:
  for i in range(100,1000):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
sc=[]
for i in range(m):
  q=list(map(int,input().split()))
  if q not in sc:
    sc.append(q)
slist=[i[0] for i in sc]
if len(slist)!=len(set(slist)):
  print("-1")
  exit()
if n!=1 and [1,0] in sc:
  print(-1)
  exit()

sc.sort()
num=""
k=0
sc.append(n+1)
for i in range(1,n+1):
  if sc[k][0]==i:
    num += str(sc[k][1])
    k+=1
  else:
    if i==1:
      num+="1"
    else:
      num += "0"
print(int(num))
    

Fixed submission:
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for i in range(m)]
# 全探索
if n==1:
  for i in range(10):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
elif n==2:
  for i in range(10,100):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
else:
  for i in range(100,1000):
    memo=0
    for li in sc:
      if str(i)[li[0]-1]!=str(li[1]):
        break
      else:
        memo+=1
    if memo==m:
      print(i)
      exit()
  print("-1")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
def Sum(i,k):
  return (sum(p[i:i+k])+k)/2
ans=0
for i in range(n-k+1):
  ans = max(ans,Sum(i,k))
print(ans)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
for i in range(n-k+1):
  if i==0:
    s=sum(p[:k])
    m=s
  else:
    s=s+p[i+k-1]-p[i-1]
    m = max(m,s)
print((m+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=list(map(int,input().split()))
q=[p[i]*(p[i]+1)/2 for i in range(n)]
def Sum(i,k):
  t=0
  for j in range(k):
    t += q[i+j]/p[i+j]
  return t
li=[]
ans=0
for i in range(n-k+1):
  ans = max(ans,Sum(i,k))
print(ans)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
for i in range(n-k+1):
  if i==0:
    s=sum(p[:k])
    m=s
  else:
    s=s+p[i+k-1]-p[i-1]
    m = max(m,s)
print((m+k)/2)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(n):
  if p[i] == min(p[:i+1]):
    #print(p[i])
    ans += 1
print(ans)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans=0
a=p[0]
for i in range(n):
  a=min(a,p[i])
  if p[i] <= a:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
xl = [list(map(int,input().split())) for i in range(n)]
xl.sort()
def OK(list):
  for i in range(n-1):
    if list[i][0]+list[i][1] > list[i+1][0]-list[i+1][1]:
      return False
  return True

while OK(xl)==False:
  r=len(xl)
  memo=[0]*r
  for i in range(r-1):
    if memo[i]==0 and xl[i][0]+xl[i][1]>xl[i+1][0]-xl[i+1][1]:
      memo[i+1] += 1
  for i in range(r):
    if memo[r-1-i]==1:
      del xl[r-1-i]
print(len(xl))

Fixed submission:
n=int(input())
xl=[list(map(int,input().split())) for i in range(n)]
xl=[i+[i[0]-i[1],i[0]+i[1]] for i in xl] # [point,arm,left,right]
xl.sort(key=lambda x: x[3])
i=0
ans=n
while i<len(xl)-1:
  if xl[i][-1]>xl[i+1][2]:
    del xl[i+1]
    ans-=1
  else:
    i+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
ans = 0
wa = 0
li = [[i] for i in range(n)]
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if "AC" not in li[p-1]:
    li[p-1].append(s)
#print(li)
for i in li:
  if "AC" in i:
    ans += 1
    wa += i.count("WA")

print(ans,wa)

Fixed submission:
n,m=map(int,input().split())
ans = 0
wa = 0
wa_list = [0] * n
ac_list = [0] * n
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)-1
  if ac_list[p] == 0:
    if s == "AC":
      ac_list[p] += 1
    else:
      wa_list[p] += 1
a=0
for i in range(n):
  if ac_list[i]==0:
    wa_list[i]=0
print(sum(ac_list),sum(wa_list))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

if a == [1]:
  print(0)
  exit()

if 1 not in a:
  print("-1")
  exit()
else:
  nokosu = 1
  a=a[a.index(1)+1:]

for i in range(2,n+1):
  if i not in a:
    print(n - nokosu)
    exit()
  else:
    nokosu += 1
    if len(a)==1:
      print(n - nokosu)
      exit()
    a = a[a.index(i)+1:]

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

if 1 not in a:
    print(-1)
    exit()

for i in a:
  if i==b:
    b+=1
  else:
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
su=sum(a)
c=[]#[abs(sum(a[:i+1])-su/2)*2 for i in range(n)]

for i in range(n):
  c+=[abs(sum(a[:i+1])-su/2)*2]
  if sum(a[:i+1])-su/2 >0 or sum(a[:i+1])-su/2==0:
    break
print(int(min(c)))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
import itertools
b = list(itertools.accumulate(a))
for i in range(n):
  b[i] = abs(2*b[i]-b[-1])
print(min(b))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
su=sum(a)
c=[abs(sum(a[:i+1])-su/2)*2 for i in range(n)]
print(int(min(c)))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
import itertools
b = list(itertools.accumulate(a))
for i in range(n):
  b[i] = abs(2*b[i]-b[-1])
print(min(b))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if max(a,b)>9:
  print(-1)
else:
  print(a＊b)


Fixed submission:
a,b=map(int,input().split())
if max(a,b)>9:
  print('-1')
else:
  print(a*b)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if max(a,b)>9:
  print('-1')
else:
  print(a＊b)

Fixed submission:
a,b=map(int,input().split())
if max(a,b)>9:
  print('-1')
else:
  print(a*b)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
ans = n-1
for i in range(int(np.sqrt(n))+1):
  if n % i == 0:
    ans = min(ans, i + n/i -2)
print(ans)

Fixed submission:
import numpy as np
n=int(input())
ans = n-1
for i in range(1,int(np.sqrt(n))+1):
  if n % i == 0:
    ans = min(ans, i + n/i -2)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
A, B = map(int, input().split())
if A - 2 * B < 0 or A-2*B == 0:
    print(0)
else:
    print(A - 2 * B)
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range(i+1):
        sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i):
        sum = sum + d[i+1] * d[j+1]
print(sum)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for k in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d[i] * d[j]
print(sum)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
d_(i+1) = [ int(input()) for i in range(N)]
sum = 0
for i in range(N):
    for j in range range(i-1):
        sum = sum + d_i * d_j
print(sum)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))
sum = 0
for i in range(N):
    if i > 0:
        for j in range(i):
            sum = sum + d[i] * d[j]
print(sum)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().split())
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)

Fixed submission:
N = int(input())
S = input()
 
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans = ans + 1
print(ans)