Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    e = [sum(range(num+1))/float(num) for num in p]
    max_v = float('-inf')
    for i in range(N-K+1):
        exp = sum(e[i:i+K])
        max_v = max(max_v, exp)
    print(max_v)
resolve()

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    p = list(map(int, input().split()))
    exp_table = [0] * 200002
    curr_sum = 0
    for i in range(1, 200002):
        curr_sum += i
        exp_table[i] = curr_sum / float(i)
    curr_sum = 0
    max_v = float('-inf')
    for i in range(len(p)):
        if i+1 < K:
            curr_sum += exp_table[p[i]]
        elif i+1 == K:
            curr_sum += exp_table[p[i]]
            max_v = max(max_v, curr_sum)
        else:
            curr_sum = curr_sum - exp_table[p[i-K]] + exp_table[p[i]]
            max_v = max(max_v, curr_sum)
        # print(curr_sum, max_v, p[i], exp_table[p[i]])
    print(max_v)
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    H = int(input())
    dp = [0] * (H + 1)
    dp[1] = 1
    for i in range(2, H + 1):
        dp[i] = 1 + 2 * dp[i // 2]
    print(dp[-1])

resolve()

Fixed submission:
def resolve():
    H = int(input())
    def sol(n):
        if n == 1:
            return 1
        return 1 + 2 * sol(n//2)
    print(sol(H))

resolve()

Buggy python submission (verdict: Runtime Error):
H = int(input())
dp = [0] * (H+1)
dp[1] = 1
for i in range(2, H+1):
  dp[i] = 1 + 2 * dp[i//2]
print(dp[-1])

Fixed submission:
def resolve():
    H = int(input())
    def sol(n):
        if n == 1:
            return 1
        return 1 + 2 * sol(n//2)
    print(sol(H))

resolve()
Buggy python submission (verdict: Runtime Error):
M, N = map(int, input())
if M == N:
  print('Yes')
else:
  print('No')

Fixed submission:
m, n = map(int, input().split())
if m == n:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
B, K = map(int, input().split())
if K >= A:
  print(0, max(0, B-K+A))
else:
  print(A-K, B)

Fixed submission:
def resolve():
    A, B, K = map(int, input().split())
    if K >= A:
        print(0, max(0, B - K + A))
    else:
        print(A - K, B)

resolve()
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
for i in range(max(a, b), a*b+1):
  if not i % a and not i % b:
    print(i)
    quit()

Fixed submission:
from fractions import gcd
a, b = map(int, input().split())
print(a*b // gcd(a, b))
Buggy python submission (verdict: Runtime Error):
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start )
  start = right
print(ans)

Fixed submission:
S = input()
acgt = {'A', 'C', 'G', 'T'}
length = len(S)
start = 0
ans = 0
while start < length:
  while start < length and S[start] not in acgt:
    start += 1
  right = start
  while right < length and S[right] in acgt:
    right += 1
  ans = max(ans, right - start)
  start = right
print(ans)
Buggy python submission (verdict: Runtime Error):
    X = input()
    stack = []
    for s in X:
        if not stack:
            stack.append(s)
            continue
        if s == 'T' and stack[-1] == 'S':
            stack.pop()
        else:
            stack.append(s)
    print(len(stack))

Fixed submission:
def resolve():
    X = input()
    stack = []
    for s in X:
        if not stack:
            stack.append(s)
            continue
        if s == 'T' and stack[-1] == 'S':
            stack.pop()
        else:
            stack.append(s)
    print(len(stack))

resolve()

Buggy python submission (verdict: Runtime Error):
X = input()
stack = []
for s in X:
  if not stack:
    stack.append(s)
  	continue
  if s == 'T' and stack[-1] == 'S':
    stack.pop()
  else:
    stack.append(s)
print(len(stack))

Fixed submission:
def resolve():
    X = input()
    stack = []
    for s in X:
        if not stack:
            stack.append(s)
            continue
        if s == 'T' and stack[-1] == 'S':
            stack.pop()
        else:
            stack.append(s)
    print(len(stack))

resolve()

Buggy python submission (verdict: Runtime Error):
X = input()
stack = []
for s in X:
  if not stack:
    stack.append(s)
  	continue
  if s == 'T' and stack[-1] == 'S':
    stack.pop()
print(len(stack))

Fixed submission:
def resolve():
    X = input()
    stack = []
    for s in X:
        if not stack:
            stack.append(s)
            continue
        if s == 'T' and stack[-1] == 'S':
            stack.pop()
        else:
            stack.append(s)
    print(len(stack))

resolve()
Buggy python submission (verdict: Time Limit Exceeded):
N,K = input().split()
N = int(N)
K = int(K)

H = input().split()
H = [int(s) for s in H]
H.sort(reverse=True)

if N < K:
  print(0)
else:
  for i in range(0,K):
    H.pop(0)

  sumdata = 0
  for i in range(0,len(H)):
    sumdata += H[i]
  print(sumdata)

Fixed submission:
import sys
input = sys.stdin.readline
N,K = input().split()
N = int(N)
K = int(K)

H = input().split()
H = [int(s) for s in H]
H.sort(reverse=True)

if N < K:
  print(0)
else:
  for i in range(0,K):
    H[i] = 0

  sumdata = 0
  for i in range(0,len(H)):
    sumdata += H[i]
  print(sumdata)
Buggy python submission (verdict: Runtime Error):
N = input()
M = input()
N = int(N)
M = int(M)

if N == M:
  print('Yes')
else:
  print('No')

Fixed submission:
N,M = input().split()
N = int(N)
M = int(M)

if N == M:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import math
A,B = input().split()
 
print(math.gcd(int(A),int(B)))

Fixed submission:
import fractions
A,B = input().split()
 
lcm = int(A) * int(B)/ fractions.gcd(int(A),int(B))
print(int(lcm))

Buggy python submission (verdict: Runtime Error):
import math
A,B = input().split()

print(math.gcd(A,B))

Fixed submission:
import fractions
A,B = input().split()
 
lcm = int(A) * int(B)/ fractions.gcd(int(A),int(B))
print(int(lcm))
Buggy python submission (verdict: Runtime Error):
N,K = input().split()
n = int(N)
k = int(K)
hList = []

for i in range(0,n):
    hList.append(int(input()))

count = 0
for i in range(0,n):
    if hList[i] >= k:
        count += 1
print(count)

Fixed submission:
N,K = input().split()
n = int(N)
k = int(K)
hList = input().split()

count = 0
for i in range(0,n):
    if int(hList[i]) >= k:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c = input().split()
n = int(a)
K = int(b)
Q = int(c)
CAList = []
AllP = []
for i in range(0,Q):
    CAList.append(int(input()))

for j in range(0,n):
    AllP.append(K)

for k in range(0,Q):
    box = AllP[CAList[k]-1]
    for l in range(0,n):
        AllP[l] = AllP[l] - 1
    AllP[CAList[k]-1] = box
    
for m in range(0,n):
    if AllP[m] >= 1:
        print('Yes')
    else:
        print('No')

Fixed submission:
a,b,c = input().split()
n = int(a)
K = int(b)
Q = int(c)
CAList = []
AllP = []
for i in range(0,Q):
    CAList.append(int(input()))

for j in range(0,n):
    AllP.append(K-Q)

for k in range(0,Q):
    AllP[CAList[k]-1] += 1
    
for m in range(0,n):
    if AllP[m] >= 1:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n,K,Q = input().split()
CAList = []
AllP = []
for i in range(0,int(Q)):
    CAList.append(input())

for j in range(0,int(n)):
    AllP.append(int(K))

for k in range(0,int(Q)):
    box = AllP[int(CAList[k])-1]
    for l in range(0,int(n)):
        AllP[l] = AllP[l] - 1
    AllP[int(CAList[k])-1] = box
    
for m in range(0,int(n)):
    if AllP[m] >= 1:
        print('Yes')
    else:
        print('No')

Fixed submission:
a,b,c = input().split()
n = int(a)
K = int(b)
Q = int(c)
CAList = []
AllP = []
for i in range(0,Q):
    CAList.append(int(input()))

for j in range(0,n):
    AllP.append(K-Q)

for k in range(0,Q):
    AllP[CAList[k]-1] += 1
    
for m in range(0,n):
    if AllP[m] >= 1:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
x = input()
if x == 1:
  print(″1″)
else:
  print(int(x) * int(x) * int(x))

Fixed submission:
n = input()
result = 0
if n == 1:
    print(1)
else:
    result = int(n) * int(n) * int(n)
    print(result)
Buggy python submission (verdict: Runtime Error):
M = input()
D = input()

count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

Fixed submission:
#入力が横に一行並んでるときはこうする↓
M,D = input().split()
 
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
M = input()
D = input()

count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if (int(y) * int(z) == j) and (int(z) != 1) and (int(y) != 1):
                count += 1
print(count)

Fixed submission:
#入力が横に一行並んでるときはこうする↓
M,D = input().split()
 
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
M = input()#5
D = input()#30


caM = []
for i in range(1,int(M)+1):
    caM.append(i)
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if (int(y) * int(z) == j) and (int(z) != 1) and (int(y) != 1):
                count += 1
print(count)

Fixed submission:
#入力が横に一行並んでるときはこうする↓
M,D = input().split()
 
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()

if a >= 3200:
  print(s)
else:
  print('Red')

Fixed submission:
a = input()
s = input()
 
if int(a) >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
s1,s2,s3 = input().split()

s1 = s1[0:1].upper
s2 = s2[0:1].upper
s3 = s3[0:1].upper
print(s1 + s2 + s3)

Fixed submission:
s1,s2,s3 = input().split()

s1 = str(s1[0:1].upper())
s2 = str(s2[0:1].upper())
s3 = str(s3[0:1].upper())
print(s1 + s2 + s3)
Buggy python submission (verdict: Runtime Error):
N = int(input())

print(N*800 - (N/15)*200)N = int(input())

print(N*800 - round((N/15))*200)

Fixed submission:
N = int(input())

print(N*800 - N//15*200)
Buggy python submission (verdict: Runtime Error):
x = input()
if int(x) >= 1200:
    print(ARC)
else:
    print(ABC)

Fixed submission:
x = input()
if int(x) >= 1200:
    print("ARC")
else:
    print("ABC")

Buggy python submission (verdict: Runtime Error):
x = input()
if x >= 1200:
    print(ARC)
else:
    print(ABC)

Fixed submission:
x = input()
if int(x) >= 1200:
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
N=int(input())
c=list(map(int,input().split()))

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
        else:
            print("DENIED")
            exit(0)

print("APPROVED")


Fixed submission:
N=int(input())
c=list(map(int,input().split()))

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            continue

        else:
            print("DENIED")
            exit(0)

print("APPROVED")

Buggy python submission (verdict: Runtime Error):
N=int(input())
c=list(map(int,input().split()))
flag=0
for i in range(N):
    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            flag=1
        else:
            flag=0
            print("DENIED")
            exit(0)

if flag==1:
    print("APPROVED")
else:
    print("DENIED!)

Fixed submission:
N=int(input())
c=list(map(int,input().split()))

for i in range(N):

    if c[i]%2==0:
        if c[i]%3==0 or c[i]%5==0:
            continue

        else:
            print("DENIED")
            exit(0)

print("APPROVED")
Buggy python submission (verdict: Runtime Error):
a1, a2, a3 = map(int, input().split())
if a1 + a2 + a3 <= 21:
  print("win)
else:
        print("bust")

Fixed submission:
a1, a2, a3 = map(int, input().split())
if a1 + a2 + a3 <= 21:
  print("win")
else:
  print("bust")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = a + b
if c + d <= 21:
  print("win")
else:
  print("bust")

Fixed submission:
a1, a2, a3 = map(int, input().split())
if a1 + a2 + a3 <= 21:
  print("win")
else:
  print("bust")
Buggy python submission (verdict: Runtime Error):
S = list(input())
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ka += 1
print(rtu)

Fixed submission:
S = list(input())
rtu = "Yes"
ks = 1
for i in S:
    if ks == 1:
        if i == "L":
            rtu = "No"
            ks = 0
            break
        else:
            ks = 0
    elif ks == 0:
        if i == "R":
            rtu = "No"
            ks = 1
            break
        else:
            ks = 1
print(rtu)
Buggy python submission (verdict: Runtime Error):
N,D = [int(i) for i in input().split()]
for i in range(N):
    lagd.append([int(i) for i in input().split()])
lngs = D - 1
def kyoricac(daone,datwo,d):
    keka = []
    n = 0
    wa = 0
    while n <= d:
        wa = (daone[n] - datwo[n])**2
        keka += [wa]
        n += 1
    wa = sum(keka)
    kaesi = float(wa ** (1/2))
    return kaesi
ans = 0
fst = 1
for i in range(N):
    for n in range(fst,N):
        flag = float(kyoricac(lagd[i],lagd[n],lngs))
        if flag.is_integer() == True:
            ans += 1
    fst += 1
print(ans)

Fixed submission:
N,D = [int(i) for i in input().split()]
lagd = []
for i in range(N):
    lagd.append([int(i) for i in input().split()])
lngs = D - 1
def kyoricac(daone,datwo,d):
    keka = []
    n = 0
    wa = 0
    while n <= d:
        wa = (daone[n] - datwo[n])**2
        keka += [wa]
        n += 1
    wa = sum(keka)
    kaesi = float(wa ** (1/2))
    return kaesi
ans = 0
fst = 1
for i in range(N):
    for n in range(fst,N):
        flag = float(kyoricac(lagd[i],lagd[n],lngs))
        if flag.is_integer() == True:
            ans += 1
    fst += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
d = int(input())
for x in range(k + 1):
    map(int,input().split())
print(n-d)

Fixed submission:
n, k = map(int,input().split())
sn = [0 for x in range(n)]
for kind in range(k):
    d = int(input())
    a_lis = list(map(int,input().split()))
    for a in a_lis:
        sn[a-1] += 1
print(sn.count(0))

Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
d = int(input())
for x in range(k + 1):
    input()
print(n-d)

Fixed submission:
n, k = map(int,input().split())
sn = [0 for x in range(n)]
for kind in range(k):
    d = int(input())
    a_lis = list(map(int,input().split()))
    for a in a_lis:
        sn[a-1] += 1
print(sn.count(0))
Buggy python submission (verdict: Runtime Error):
#b.py
n = int(input())
lis = list(map(int,input()))
ans = 0
for x,y,z in zip(lis,lis[1:],lis[2:]):
    if x < y < z:
        ans += 1
print(ans)

Fixed submission:
#b.py
n = int(input())
lis = list(map(int,input().split()))
ans = 0
for x,y,z in zip(lis,lis[1:],lis[2:]):
    if x < y < z or z < y < x:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
#c.py
from math import gcd
def lcm(a, b):
    return a * b // gcd(a,b)
a,b,c,d = map(int,input().split())
canC = b//c -(a-1)//c
canD = b//d - (a-1)//d
dbCD = b//lcm(c,d) -(a-1)//lcm(c,d)
print((b-a+1) -canC - canD + dbCD)

Fixed submission:
#c.py
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b // gcd(a,b)
a,b,c,d = map(int,input().split())
canC = int(b//c) -int((a-1)//c)
canD = int(b//d) - int((a-1)//d)
dbCD = int(b//lcm(c,d)) -int((a-1)//lcm(c,d))
print((b-a+1) -canC - canD + dbCD)

Buggy python submission (verdict: Runtime Error):
#c.py
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b / gcd(a,b)
a,b,c,d = map(int,input().split())
canC = int(b//c) -int((a-1)//c)
canD = int(b//d) - int((a-1)//d))
dbCD = int(b//lcm(c,d)) -int((a-1)//lcm(c,d))
print((b-a+1) -canC - canD + dbCD)


Fixed submission:
#c.py
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def lcm(a, b):
    return a * b // gcd(a,b)
a,b,c,d = map(int,input().split())
canC = int(b//c) -int((a-1)//c)
canD = int(b//d) - int((a-1)//d)
dbCD = int(b//lcm(c,d)) -int((a-1)//lcm(c,d))
print((b-a+1) -canC - canD + dbCD)
Buggy python submission (verdict: Runtime Error):
#c.py
w,h,x,y = map(int,input().split())
min(w * y,(w*h)-w*y)
min(h * x,(w*h)-h*x)
if x > w//2 and y > h//2:
    m = 
if w//2 == x and h//2 == y:
    print(w*h/2,0)
else:
    ans = max(min(w*y,(w*h)-w*y),min(h*x,(w*h)-h*x))
    print(ans,1)



Fixed submission:
#c.py
w,h,x,y = map(int,input().split())
if w/2 == x and h/2 == y:
    print(w*h/2,1)
else:
    print(w*h/2,0)
Buggy python submission (verdict: Runtime Error):
#b.py
n = int(input())
lis = [list(input().split())+[x] for x in range(n)]
lis = sorted(lis,key=lambda x:x[0])
now = lis[0][0]
ans_lis = []
sublis = []
for x in lis:
    if x[0] == now:
        sublis.append(x)
    else:
        now = x[0]
        sublis = sorted(sublis,key=lambda x:int(x[1]),reverse=True)
        print(int(x[1]))
        ans_lis.append(sublis)
        sublis = []
        sublis.append(x)
for x in ans_lis:
    print(x[2]+1)



Fixed submission:
#b.py
n = int(input())
lis = [list(input().split())+[x] for x in range(n)]
lis = sorted(lis,key=lambda x:x[0])
now = lis[0][0]
ans_lis = []
sublis = []
for x in lis:
    if x[0] == now:
        sublis.append(x)
    else:
        now = x[0]
        sublis = sorted(sublis,key=lambda x:int(x[1]),reverse=True)
        ans_lis.append(sublis)
        sublis = []
        sublis.append(x)
sublis.sort(key=lambda x:int(x[1]),reverse=True)
ans_lis.append(sublis)
sublis = []
sublis.append(x)       
ans_lis = [item for sublist in ans_lis for item in sublist]
for x in ans_lis:
    print(x[2]+1)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
v = map(int,input().split())

ans = 0

for l in range(n):
    for r in range(n-l+1):
        if l+r >k:
            break
        nv = v[:l] + v[n-r:]
        nv.sort()
        for i in range(k-l-r):
            if not nv or nv[0] >= 0:
                break
            nv.pop(0)
        ans = max(ans,sum(nv))
print(ans)


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

ans = 0

for l in range(n):
    for r in range(n-l+1):
        if l+r >k:
            break
        nv = v[:l] + v[n-r:]
        nv.sort()
        for i in range(k-l-r):
            if not nv or nv[0] >= 0:
                break
            nv.pop(0)
        ans = max(ans,sum(nv))
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
xyz = [list(map(int,input().split())) for x in range(m)]

checked = [x for x in range(1,n+1)] #checked = 0
xyz.sort()
ans=n
for i in xyz:
    x,y,z = i
    if x in checked and y in checked:
        checked[x-1]=0
        checked[y-1]=0
        ans-=1 #no check
    elif x in checked or y in checked:
        checked[x-1]=0
        checked[y-1]=0
        ans-=1 #one check
    else:
        pass
print(ans)


Fixed submission:
N,K=map(int,input().split())
s=input()
S=s.lower()
print(s[:K-1]+S[K-1:K]+s[K:])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
p_lis = []
import math
for x in range(1,n+1):
    power = -((-math.log2(k//x))//1)
    p_lis.append(((1/2)**power)*(1/n))
print(sum(p_lis))


Fixed submission:
n,k=map(int,input().split())
p_lis = []
for x in range(1,n+1):
    if k>x:
        i=1
        while x*2<k:
            x*=2
            i+=1
        p_lis.append(((1/2)**i)*(1/n))
    else:
        p_lis.append(1/n)
print(sum(p_lis))
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,n=map(int,input().split())
ans=0
for r in range(((n+1)//R)+1):
    for g in range(((n+1)//G)+1):
        if ((n-r*R - g*G)%B)== 0 and (n-r*R-g*G)>=0:
            ans+=1
print(ans)


Fixed submission:
R,G,B,n=map(int,input().split())
ans=0
for r in range(((n+1)//R)+1):
    for g in range(((n+1)//G)+1):
        if ((n-r*R - g*G)%B)== 0 and (n-r*R-g*G)>=0:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
flag = S[K]
ans = []
for x in S:
    if x == flag:
        ans.append(x)
    else:
        ans.append('*')
print(''.join(ans))


Fixed submission:
N = int(input())
S = input()
K = int(input())
flag = S[K-1]
ans = []
for x in S:
    if x == flag:
        ans.append(x)
    else:
        ans.append('*')
print(''.join(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
bs = 0
ws = s.count('.')
ans = n
for c in s:
    if c == '.':
        ws -= 1
            else:
        bs += 1
    now = ws + bs
    if ans > now:
        ans = now
print(ans)


Fixed submission:
n = int(input())
s = input()
lis = []
ws=s.count('.')
lis.append(ws)
bs = 0
for x in s:
    if x == '#':
        bs += 1
        lis.append(bs+ws)
    else:
        ws -= 1
    lis.append(bs+ws)
print(min(lis))
Buggy python submission (verdict: Runtime Error):
A,B = int(input())
if A == B:
    print(A*2)
elif A > B:
    print(A*2-1)
else:
    print(B*2-1)


Fixed submission:
A,B = map(int,input().split())
if A == B:
    print(A*2)
elif A > B:
    print(A*2-1)
else:
    print(B*2-1)