Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=str(input())
r=s[:(n/2)]
t=s[(n/2):]
if(r==t):
  print("Yes")
else:
  print("No")


Fixed submission:
n=int(input())
s=str(input())
r=s[:n//2]
t=s[n//2:]
if(r==t):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=str(input())
if(n%2==0):
  r=s[:(n/2)]
  t=s[(n/2):]
  if(r==t):
    print("Yes")
  else:
    print("No")
    
else:
  print("No")

Fixed submission:
n=int(input())
s=str(input())
r=s[:n//2]
t=s[n//2:]
if(r==t):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
x=[0]*n
for i in range(n):
  for j in range(n):
    if(j+1==a[i]):
      x[j]=i+1
  
print(" ".join(map(str,x)))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=[0]*n
for i in range(n):
  x[a[i]-1]=i+1
  
print(" ".join(map(str,x)))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if(n<10):
  x=n
elif(n<100):
  x=9
elif(n<1000):
  x=n-90
elif(n<10000):
  x=
elif(x<100000):
  x=n-90-9000

Fixed submission:
n=int(input())
if(n<10):
  x=n
elif(n<100):
  x=9
elif(n<1000):
  x=n-90
elif(n<10000):
  x=9+900
elif(n<100000):
  x=n-90-9000
elif(n==100000):
  x=90909
print(x)
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
a=list(range(l,l+n,1))
x=sum(a)
if(a in 0):
  a.remove(0)
  print(sum(a))
elif(x<0):
  a.remove(max(a))
  print(sum(a))
elif(x>0):
  a.remove(min(a))
  print(sum(a))

Fixed submission:
n,l=map(int,input().split())
a=list(range(l,l+n,1))
x=sum(a)
if(0 in a):
  a.remove(0)
  print(sum(a))
elif(x<0):
  a.remove(max(a))
  print(sum(a))
elif(x>0):
  a.remove(min(a))
  print(sum(a))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=[0 for i in range(n)]
y=[]
s=0
for i in range(n):
  if a[i] in a:
    x[a[i]-1]+=1
    
for i in range(n):
  if x[i]:
    y.append(x[i])
y.sort()
i=0
while(len(y)>k):
  s+=y[i]
  y.pop(i)
  i+=1
print(s)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
x=[0 for i in range(n)]
y=[]
s=0
for i in range(n):
  x[a[i]-1]+=1
    
for i in range(n):
  if x[i]:
    y.append(x[i])
y.sort()
z=len(y)
i=0
while(z>k):
  s+=y[i]
  z-=1
  i+=1
print(s)
Buggy python submission (verdict: Runtime Error):
k=input()
ans=[]
for i in range(int(k)):
  ans.append("ACL")

print("".joint(ans))


Fixed submission:
k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))

Buggy python submission (verdict: Runtime Error):
import sys
k=sys.stdin
ans=[]
for i in range(int(k)):
  ans.append("ACL")

print("".joint(ans))


Fixed submission:
k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))

Buggy python submission (verdict: Runtime Error):
k=sys.stdin
ans=[]
for i in range(int(k)):
  ans.append("ACL")

print("".joint(ans))


Fixed submission:
k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))

Buggy python submission (verdict: Runtime Error):
k=input()
ans=[]
for i in range(k):
  ans.append("ACL")

print("".joint(ans))


Fixed submission:
k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))

Buggy python submission (verdict: Runtime Error):
k=input()
ans=[]
for i in range(k):
  ans.append("ACL")
 
print("".joint(ans))

Fixed submission:
k = int(input())
ans=[]
for i in range(k):
  ans.append("ACL")

print("".join(ans))
Buggy python submission (verdict: Runtime Error):

            break

    if sum(tensuulist)<=0:
        continue
    else:
        syuki=len(tensuulist)
        tensuu+=(nokoriidoukaisuu//syuki)*sum(tensuulist)
        nokoriidoukaisuu%=syuki
        for i in range(nokoriidoukaisuu):
            tensuu+=tensuulist[i]
            ans=max(ans,tensuu)

print(ans)

Fixed submission:
n,k = map(int, input().split())
p = [0]+[int(x) for x in input().split()]
c = [0]+[int(x) for x in input().split()]

ans=-10**18

for saisyo in range(1,n+1):
    tensuulist=[]
    genzaiti=saisyo

    while(True):
        genzaiti=p[genzaiti]
        tensuulist.append(c[genzaiti])
        if genzaiti==saisyo:
            break

    goukei=sum(tensuulist)
    nagasa=len(tensuulist)
    kaisuu=k
    syou=kaisuu//nagasa
    amari=kaisuu%nagasa

    tensuu=0
    nokorikaisuu=0

    if goukei<=0:
        for i in range(nagasa):
            tensuu+=tensuulist[i]
            ans=max(ans,tensuu)
    else:
        if 3*nagasa<kaisuu:
            tensuu+=goukei*(syou-1)
            nokorikaisuu=nagasa+amari
            for i in range(nokorikaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)
        else:
            for i in range(kaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)

print(ans)

Buggy python submission (verdict: Runtime Error):

            break

    if sum(tensuulist)<=0:
        continue
    else:
        syuki=len(tensuulist)
        tensuu+=(nokoriidoukaisuu//syuki)*sum(tensuulist)
        nokoriidoukaisuu%=syuki
        for i in range(nokoriidoukaisuu):
            tensuu+=tensuulist[i]
            ans=max(ans,tensuu)

print(ans)

Fixed submission:
n,k = map(int, input().split())
p = [0]+[int(x) for x in input().split()]
c = [0]+[int(x) for x in input().split()]

ans=-10**18

for saisyo in range(1,n+1):
    tensuulist=[]
    genzaiti=saisyo

    while(True):
        genzaiti=p[genzaiti]
        tensuulist.append(c[genzaiti])
        if genzaiti==saisyo:
            break

    goukei=sum(tensuulist)
    nagasa=len(tensuulist)
    kaisuu=k
    syou=kaisuu//nagasa
    amari=kaisuu%nagasa

    tensuu=0
    nokorikaisuu=0

    if goukei<=0:
        for i in range(nagasa):
            tensuu+=tensuulist[i]
            ans=max(ans,tensuu)
    else:
        if 3*nagasa<kaisuu:
            tensuu+=goukei*(syou-1)
            nokorikaisuu=nagasa+amari
            for i in range(nokorikaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)
        else:
            for i in range(kaisuu):
                tensuu+=tensuulist[(i%nagasa)]
                ans=max(ans,tensuu)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m,k = map(int, input().split())
a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

Goukei_a=[a[0]]
for i in range(1,n+1):
    Goukei_a.append(Goukei_a[i-1]+a[i])

Goukei_b=[b[0]]
for i in range(1,m+1):
    Goukei_b.append(Goukei_b[i-1]+b[i])

goukei=0
kaisuu=0
ans=0

for i in range(0,n+1):
    if Goukei_a[i]>k:
        break
    for j in range(0,m+1):
        if Goukei_b[j]>k:
            break
        goukei=Goukei_a[i]+Goukei_b[j]
        if goukei<=k:
            ans=max(ans,i+j)
        else:
            break
    
print(ans)

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

a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

for i in range(1,n+1):
    a[i]+=a[i-1]
for i in range(1,m+1):
    b[i]+=b[i-1]

b_cnt=m
ans=0

for a_cnt in range(n+1):
    if a[a_cnt]>k:
        break
    while a[a_cnt]+b[b_cnt]>k:
         b_cnt-=1
    ans=max(ans,a_cnt+b_cnt)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m,k = map(int, input().split())
a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

Goukei_a=[a[0]]
for i in range(1,n+1):
    Goukei_a.append(Goukei_a[i-1]+a[i])

Goukei_b=[b[0]]
for i in range(1,m+1):
    Goukei_b.append(Goukei_b[i-1]+b[i])

goukei=0
kaisuu=0
ans=0

for i in range(0,n+1):
    for j in range(0,m+1):
        goukei=Goukei_a[i]+Goukei_b[j]
        if goukei<=k:
            ans=max(ans,i+j)
        else:
            break
    
print(ans)

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

a = [0]+list(map(int, input().split()))
b = [0]+list(map(int, input().split()))

for i in range(1,n+1):
    a[i]+=a[i-1]
for i in range(1,m+1):
    b[i]+=b[i-1]

b_cnt=m
ans=0

for a_cnt in range(n+1):
    if a[a_cnt]>k:
        break
    while a[a_cnt]+b[b_cnt]>k:
         b_cnt-=1
    ans=max(ans,a_cnt+b_cnt)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def calc(sykou,makkou,kousuu):
    return int((sykou+makkou)/2*kousuu)

ans=0
for i in range(1,n+1):
    ans+=(calc(i,n//i*i,n//i))

print(ans)

Fixed submission:
n=int(input())
def calc(sykou,makkou,kousuu):
    return int((sykou+makkou)/2*kousuu)

ans=0
for i in range(1,n+1):
    ans+=(calc(i,n//i*i,n//i))

print(ans)
Buggy python submission (verdict: Runtime Error):
str=str(input())
if str.isupper():
	print("A")
else
	print("a")

Fixed submission:
str=str(input())
if str.isupper():
	print("A")
else:
	print("a")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans=0

a.sort()

while len(a)>0:
    k=a[0]
    kesu=[]
    tyouhuku=False
    for i in range(1,len(a)):
        if a[i]==k:
            tyouhuku=True
        if a[i]%k==0:
            kesu.append(a[i])
    
    for i in range(len(kesu)):
        a=[j for j in a if j !=kesu[i]]
    
    if not tyouhuku:
        a.pop(0)
        ans+=1



print(ans)

Fixed submission:
n = int(input())

a = [int(x) for x in input().split()]

baisuu=[0]*(10**6+1)

for i in a:
	if baisuu[i]>=1:
		baisuu[i]=2
		continue

	for j in range(i,10**6+1,i):
		baisuu[j]+=1

ans=0

for i in a:
	if baisuu[i]==1:
		ans+=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans=0

a.sort()

while len(a)>0:
    k=a[0]
    kesu=[]
    tyouhuku=False
    for i in range(1,len(a)):
        if a[i]==k:
            tyouhuku=True
        if a[i]%k==0:
            kesu.append(a[i])
    
    for i in range(len(kesu)):
        a=[j for j in a if j !=kesu[i]]
    
    if not tyouhuku:
        a.pop(0)
        ans+=1



print(ans)

Fixed submission:
n = int(input())

a = [int(x) for x in input().split()]

baisuu=[0]*(10**6+1)

for i in a:
	if baisuu[i]>=1:
		baisuu[i]=2
		continue

	for j in range(i,10**6+1,i):
		baisuu[j]+=1

ans=0

for i in a:
	if baisuu[i]==1:
		ans+=1

print(ans)

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

a = [int(x) for x in input().split()]

a.sort()
if a[0]==a[1]:
	ans=0
else:
	ans=1

for i in range(0,len(a)):
	for j in range(len(a)):
		if a[i]%a[j]==0:
			break
		if j==i-1:
			ans+=1
			break

print(ans)


Fixed submission:
n = int(input())

a = [int(x) for x in input().split()]

baisuu=[0]*(10**6+1)

for i in a:
	if baisuu[i]>=1:
		baisuu[i]=2
		continue

	for j in range(i,10**6+1,i):
		baisuu[j]+=1

ans=0

for i in a:
	if baisuu[i]==1:
		ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = int(input().split())
if K<=A:
    print(K)
elif A<K<=A+B:
    print(A)
else:
    print(A-(K-A-B))

Fixed submission:
A, B, C, K = map(int, input().split())
if K<=A:
    print(K)
elif A<K<=A+B:
    print(A)
else:
    print(A-(K-A-B))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n,k = map(int, input().split())
a = [0]+list(map(int, input().split()))

genzaiti=1
imamade=deque([1])
hantei=True

while k>0:
    k-=1
    genzaiti=a[genzaiti]

    if hantei:
        for i in range(len(imamade)):
            if imamade[i]==genzaiti:
                kaiten=len(imamade)-i
                k%=kaiten
                hantei=False
                break
    
    imamade.append(genzaiti)

print(genzaiti)

Fixed submission:
from collections import deque
n,k = map(int, input().split())
a = [0]+list(map(int, input().split()))

genzaiti=1
otozure=[-1]*(10**6)
hantei=True

otozure[1]=0
houmon=0
idou_kaisuu=0

while k>0:
    idou_kaisuu+=1
    k-=1
    genzaiti=a[genzaiti]

    if hantei:
        if otozure[genzaiti]!=-1:
            kaiten=idou_kaisuu-otozure[genzaiti]
            k%=kaiten
            hantei=False
    
    otozure[genzaiti]=idou_kaisuu

print(genzaiti)
Buggy python submission (verdict: Runtime Error):
N,K= map(int, input().split())

A=[]

for i range(K):
    d = int(input())
    A[i] = [int(x) for x in input().split()]

print(3)

Fixed submission:
Sunuke=[]

N, K = map(int, input().split()) 
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))

    Sunuke.extend(A)

print(N-(len(set(Sunuke))))

Buggy python submission (verdict: Runtime Error):
N,K= map(int, input().split())

A=[]

for i range(K)
    d = int(input())
    A[i] = [int(x) for x in input().split()]

print("A")

Fixed submission:
Sunuke=[]

N, K = map(int, input().split()) 
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))

    Sunuke.extend(A)

print(N-(len(set(Sunuke))))
Buggy python submission (verdict: Time Limit Exceeded):
s ="0"+ input()

nagasa=len(s)
ans=0

for i in range(1,nagasa):
    if nagasa-i<4:
        break
    for k in range(nagasa,1,-1):
        if k-i<4:
            break
        if int(s[i:k])%2019==0:
            ans+=1

print(ans)

Fixed submission:
s = input()

ans=0
s=s[::-1]
t=1
ketame=0
amari10=1
kosuu=[1]+[0]*2020
for i in s:
    ketame=(ketame+(int(i)*amari10)%2019)%2019
    amari10*=10
    amari10%=2019
    kosuu[ketame]+=1

for i in range(len(kosuu)):
    if kosuu[i]>0:
        ans+=kosuu[i]*(kosuu[i]-1)/2
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s ="0"+ input()

nagasa=len(s)
ans=0

for i in range(1,nagasa):
    if nagasa-i<4:
        break
    for k in range(nagasa,1,-1):
        if k-i<4:
            break
        if int(s[i:k])%2019==0:
            ans+=1

print(ans)

Fixed submission:
s = input()

ans=0
s=s[::-1]
t=1
ketame=0
amari10=1
kosuu=[1]+[0]*2020
for i in s:
    ketame=(ketame+(int(i)*amari10)%2019)%2019
    amari10*=10
    amari10%=2019
    kosuu[ketame]+=1

for i in range(len(kosuu)):
    if kosuu[i]>0:
        ans+=kosuu[i]*(kosuu[i]-1)/2
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s ="0"+ input()

nagasa=len(s)
ans=0

import itertools
for seq in itertools.combinations(range(1,nagasa+1),2):
    num=int(s[seq[0]:seq[1]])
    if num%2019==0:
        ans+=1

print(ans)

Fixed submission:
s = input()

ans=0
s=s[::-1]
t=1
ketame=0
amari10=1
kosuu=[1]+[0]*2020
for i in s:
    ketame=(ketame+(int(i)*amari10)%2019)%2019
    amari10*=10
    amari10%=2019
    kosuu[ketame]+=1

for i in range(len(kosuu)):
    if kosuu[i]>0:
        ans+=kosuu[i]*(kosuu[i]-1)/2
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
s="0"+s
num="0"
ans=0

for i in range(1,len(s)):
    for j in range(i,len(s)):
        num="0"
        for k in range(i,j+1):
            num+=s[k]
        if int(num)%2019==0:
            ans+=1

print(ans)

Fixed submission:
s = input()

ans=0
s=s[::-1]
t=1
ketame=0
amari10=1
kosuu=[1]+[0]*2020
for i in s:
    ketame=(ketame+(int(i)*amari10)%2019)%2019
    amari10*=10
    amari10%=2019
    kosuu[ketame]+=1

for i in range(len(kosuu)):
    if kosuu[i]>0:
        ans+=kosuu[i]*(kosuu[i]-1)/2
    
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())

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

a.sort()

tmp=0
cnt=0

for bangou in range(1,n+1):
    if tmp<len(a):
        while a[tmp]==bangou:
            cnt+=1
            tmp+=1
            if tmp==len(a):
                break
    print(cnt)
    cnt=0
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())

ans=0
import itertools
import math
for seq in itertools.product(range(1,k+1),range(1,k+1),range(1,k+1)):
    ans+=math.gcd(math.gcd(seq[0],seq[1]),seq[2])
print(ans)

Fixed submission:
k=int(input())

ans=0
import itertools
import math
for seq in itertools.combinations_with_replacement(range(1,k+1),3):
    if seq[0]==seq[1] or seq[1]==seq[2]:
        if  seq[0]!=seq[2]:
            ans+=(math.gcd(seq[0],math.gcd(seq[1],seq[2])))*3
        else:
            ans+=math.gcd(seq[0],math.gcd(seq[1],seq[2]))

    else:
        ans+=math.gcd(seq[0],math.gcd(seq[1],seq[2]))*6
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s=input()

s1=""

for i in s:
    if i=="R":s1+="1"
    elif i=="G":s1+="2"
    elif i=="B":s1+="4"


l1=int(s1,16)
l2=int(s1,16)

ans=0

l2*=16

for i in range(2,n):
    l2*=16
    l3=int(s1,16)
    for j in range(1,i):
        l3*=16
        if j==i-j:
            continue
        tasi=l1+l2+l3
        ans+=hex(tasi).count("7")

print(ans)

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

ans=s.count("R")*s.count("G")*s.count("B")

for start in range(n):
    for kousa in range(n):
        if start+2*kousa>n-1:
            break
        if s[start]!=s[start+kousa] and s[start+kousa]!=s[start+2*kousa] and s[start+2*kousa]!=s[start]:
            ans-=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s=input()

s1=""

for i in s:
    if i=="R":s1+="1"
    elif i=="G":s1+="2"
    elif i=="B":s1+="4"

ans=0

import itertools
for seq in itertools.combinations(range(1,n),2):
    if seq[0]==seq[1]-seq[0]:
        continue
    l1=int(s1,16)
    l2=int(s1,16)*16**seq[0]
    l3=int(s1,16)*16**seq[1]

    tasi=l1+l2+l3

    ans+=hex(tasi).count("7")

print(ans)

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

ans=s.count("R")*s.count("G")*s.count("B")

for start in range(n):
    for kousa in range(n):
        if start+2*kousa>n-1:
            break
        if s[start]!=s[start+kousa] and s[start+kousa]!=s[start+2*kousa] and s[start+2*kousa]!=s[start]:
            ans-=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s=input()
ans=0

import itertools
for seq in itertools.combinations(range(n),3):
    if s[seq[0]]!=s[seq[1]] and s[seq[1]]!=s[seq[2]] and s[seq[2]]!=s[seq[0]] and seq[1]-seq[0]!=seq[2]-seq[1]:
        ans+=1

print(ans)    

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

ans=s.count("R")*s.count("G")*s.count("B")

for start in range(n):
    for kousa in range(n):
        if start+2*kousa>n-1:
            break
        if s[start]!=s[start+kousa] and s[start+kousa]!=s[start+2*kousa] and s[start+2*kousa]!=s[start]:
            ans-=1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

ans=0

for num in range(1,10**10):
    num_str=str(num)
    num_str=num_str[::-1]
    hantei=True

    if len(num_str)>1:
        for i in range(len(num_str)-1):
            if abs(int(num_str[i])-int(num_str[i+1]))>1:
                hantei=False
                break
    if hantei:
        ans+=1

        if k==ans:
            print(num)
            exit()

Fixed submission:
k = int(input())

num=[1,2,3,4,5,6,7,8,9]

if k<10:
    print(num[k-1])
    exit()

ans=9

def hantei():
    global ans
    ans+=1
    if ans==k:
        print(num[-1])
        exit()

for i in range(10**10):

    hitoketa=num[0]%10

    if hitoketa==0:
        num.append(10*num[0]+0)
        hantei()
        num.append(10*num[0]+1)
        hantei()
        num.pop(0)

    elif hitoketa==9:
        num.append(10*num[0]+8)
        hantei()
        num.append(10*num[0]+9)
        hantei()
        num.pop(0)

    else:
        num.append(10*num[0]+(hitoketa-1))
        hantei()
        num.append(10*num[0]+(hitoketa))
        hantei()
        num.append(10*num[0]+(hitoketa+1))
        hantei()
        num.pop(0)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())

for i in range(q):
    tmp=input()
    if len(tmp)==1:
        s=s[::-1]
    else:
        if tmp[2]=="1":
            s=tmp[4]+s
        else:
            s=s+tmp[4]

print(s)

Fixed submission:
s = input()
q = int(input())
hanten=False
mae=""
usiro=""
for i in range(q):
    tmp=input()
    if len(tmp)==1:
        hanten=not(hanten)
    else:
        if hanten==False:
            if tmp[2]=="1":
                mae=tmp[4]+mae
            else:
                usiro=usiro+tmp[4]
        else:
            if tmp[2]=="1":
                usiro=usiro+tmp[4]
            else:
                mae=tmp[4]+mae
                
ans=mae+s+usiro
if hanten==False:
    print(ans)
else:
    print(ans[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split()) 

p = [int(x) for x in input().split()]

p_kitaiti=[]

for i in p:
    goukei=(i*(i+1))/2
    p_kitaiti.append(goukei/i)

ans=0

for i in range(len(p_kitaiti)-k+1):
    zantei=sum(p_kitaiti[i:i+k])
    ans=max(ans,zantei)

print(ans)

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

p = [int(x) for x in input().split()]
p_kitaiti=[float((x+1)/2) for x in p]

ruisekiwa=[p_kitaiti[0]]

for i in range(1,len(p_kitaiti)):
    ruisekiwa.append(ruisekiwa[-1]+p_kitaiti[i])

ans=ruisekiwa[k-1]

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

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans_list=[[0]*(n+1) for i in range(n+1)]
kotaezyun=[]
renketu=[[] for i in range(n+1)]
for i in range(n-1):
    a,b=map(int, input().split())
    renketu[a].append(b)
    kotaezyun.append([a,b])

from collections import deque
que=deque()

que.append(1)

iro=[-1]*(n+1)
iro[1]=0
irokazu=0

tansaku_moto=[1]

while que:
    tansaku_moto=que.popleft()
    ironuri=1
    for tansaku_saki in renketu[tansaku_moto]:
        if ironuri==iro[tansaku_moto]:
            ironuri+=1
        ans_list[tansaku_moto][tansaku_saki]=ironuri
        iro[tansaku_saki]=ironuri
        que.append(tansaku_saki)
        irokazu=max(irokazu,ironuri)
        ironuri+=1
        
print(irokazu)
for i in range(n-1):
    print(ans_list[kotaezyun[i][0]][kotaezyun[i][1]])

Fixed submission:
n=int(input())
kotaezyun=[]
renketu=[[] for i in range(n+1)]
ans_dict={}
for i in range(n-1):
    a,b=map(int, input().split())
    renketu[a].append(b)
    kotaezyun.append([a,b])

from collections import deque
que=deque()

que.append(1)

iro=[-1]*(n+1)
iro[1]=0
irokazu=0

tansaku_moto=[1]

while que:
    tansaku_moto=que.popleft()
    ironuri=1
    for tansaku_saki in renketu[tansaku_moto]:
        if ironuri==iro[tansaku_moto]:
            ironuri+=1
        iro[tansaku_saki]=ironuri
        ans_dict[tansaku_moto,tansaku_saki]=ironuri
        que.append(tansaku_saki)
        irokazu=max(irokazu,ironuri)
        ironuri+=1
        
print(irokazu)
for i in range(n-1):
    tmp=(kotaezyun[i][0],kotaezyun[i][1])
    print(ans_dict[tmp])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
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

pri_fact=prime_factorize(n)

def prod(x):
    kotae=1
    for i in x:
        kotae*=i
    return kotae

ans=10**120
import itertools

for r in range(len(pri_fact)):
# (1,2,3),(1,2,4),---,(7,8,9)
    for seq in itertools.combinations(range(len(pri_fact)),r):
        a=[1]
        b=[1]
        for i in range(len(pri_fact)):
            if i in seq:
                a.append(pri_fact[i])
            else:
                b.append(pri_fact[i])
        ans=min(prod(a)+prod(b)-2,ans)
print(ans)

Fixed submission:
n=int(input())

ans=10**12
d=2
while d<=n**(1/2):
    if n%d==0:
        ans=min(ans,d+n//d-2)
    d+=1
if ans==10**12:
    print(n-1)
    exit()
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
import numpy
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

pri_fact=prime_factorize(n)

def prod(x):
    kotae=1
    for i in x:
        kotae*=i
    return kotae

ans=10**12
for i in range(len(pri_fact)):
    ans=min((prod(pri_fact[0:i])-1)+(prod(pri_fact[i:])-1),ans)

print(int(ans))


Fixed submission:
n=int(input())

ans=10**12
d=2
while d<=n**(1/2):
    if n%d==0:
        ans=min(ans,d+n//d-2)
    d+=1
if ans==10**12:
    print(n-1)
    exit()
print(ans)