Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N=int(input())
A,B= list(map(int,input().split())),list(map(int,input().split()))

ans = 0
for i,b in enumerate(B):
    temp = min(b,A[i]+A[i+1])
    ans += temp
    A[i+1] -= max(0, temp-A[i]) #有り余った力を次の街で倒す
print(an)


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

ans = 0
for i,b in enumerate(B):
    temp = min(b,A[i]+A[i+1])
    ans += temp
    A[i+1] -= max(0, temp-A[i]) #有り余った力を次の街で倒す
print(ans)
Buggy python submission (verdict: Runtime Error):
N=input()
s=input()
K=int(input())

t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))


Fixed submission:
N=int(input())
s=list(input())
K=int(input())
t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))

Buggy python submission (verdict: Runtime Error):
N=input()
s=input()
K=int(input())

t=s[K-1]
for i in range(N):
    if s[i]!=t:
        S[i]="*"
print("".join(s))


Fixed submission:
N=int(input())
s=list(input())
K=int(input())
t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))
Buggy python submission (verdict: Runtime Error):
n,l = map(int, input().split())
s = [input() for i in range(N)]
print("".join(s.sort()))

Fixed submission:
n,l = map(int, input().split())
s = [input() for i in range(n)]
s.sort()
print("".join(s))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 0
s = sum(a)-a[0]
for i in range(n-1):
  ans+=(a[i]*s)
  ans%=st
  s-=a[i+1]
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
st=10**9+7
ans = 0
s = sum(a)-a[0]
for i in range(n-1):
  ans+=(a[i]*s)
  ans%=st
  s-=a[i+1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
def divisor(n):
   x = {}
   while n % 2 == 0:
      if "2" not in x.keys():
         x["2"] = 1
      else:
         x["2"]+=1
      n = n/2
   for i in range(3,int(math.sqrt(n))+1,2):
      while n%i == 0:
         tmp = str(i)
         if tmp not in x.keys():
            x[tmp] = 1
         else:
            x[tmp] +=1
         n = n/i
   if n > 2:
      tmp = str(n)
      x[tmp] = 1
   res = 1
   for item in x.values():
      res*=(item+1)
   return res
n = int(input())
sum=0
for i in range(1,n+1):
   sum+=(i*divisor(i))
print(sum)

Fixed submission:
import math
def solver(n):
    sum = 0
    for i in range(1,n+1):
        y = math.floor(n/i)
        sum+=(i*y*(y+1)/2)
    return int(sum)


n = int(input())
print(solver(n))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
height = list(map(int,input().split()))
arr = []

for i in range(m):
   x, y = map(int,input().split())
   height_x = height[x-1]
   height_y = height[y-1]
   if height_x > height_y:
      if y not in arr:
         arr.append(y)
   elif height_x < height_y:
      if x not in arr:
         arr.append(x)
   else:
      if x not in arr:
         arr.append(x)
      if y not in arr:
         arr.append(y)
print(n-len(arr))



Fixed submission:
n, m = map(int,input().split())
height = list(map(int,input().split()))
arr = []

for i in range(m):
   x, y = map(int,input().split())
   height_x = height[x-1]
   height_y = height[y-1]
   if height_x > height_y:
      arr.append(y)
   elif height_x < height_y:
      arr.append(x)
   else:
      arr.append(x)
      arr.append(y)
arr = list(set(arr))
print(n-len(arr))
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
        a.append(tmp)
a.sort()
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if tmp == 0:
        min = tmp
        break
    if min > tmp:
        min = tmp
print(min)


Fixed submission:
import sys
l, r = map(int, input().split())
if r-l>=2019:
    print("0")
elif r%2019==0 or l%2019==0:
    print("0")
else:
    min = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            if min > tmp:
                min = tmp
            if min == 0:
                print("0")
                sys.exit()
    print(min)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
        a.append(tmp)
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if tmp == 0:
        min = tmp
        break
    if min > tmp:
        min = tmp
print(min)


Fixed submission:
import sys
l, r = map(int, input().split())
if r-l>=2019:
    print("0")
elif r%2019==0 or l%2019==0:
    print("0")
else:
    min = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            if min > tmp:
                min = tmp
            if min == 0:
                print("0")
                sys.exit()
    print(min)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
        a.append(tmp)
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if min > tmp:
        min = tmp
print(min)


Fixed submission:
import sys
l, r = map(int, input().split())
if r-l>=2019:
    print("0")
elif r%2019==0 or l%2019==0:
    print("0")
else:
    min = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            if min > tmp:
                min = tmp
            if min == 0:
                print("0")
                sys.exit()
    print(min)

Buggy python submission (verdict: Runtime Error):
from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if min > tmp:
        min = tmp
print(min)


Fixed submission:
import sys
l, r = map(int, input().split())
if r-l>=2019:
    print("0")
elif r%2019==0 or l%2019==0:
    print("0")
else:
    min = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            if min > tmp:
                min = tmp
            if min == 0:
                print("0")
                sys.exit()
    print(min)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
arr = [0]*n
for i in range(m):
    l, r = map(int, input().split())
    for j in range(l-1,r):
        arr[j]+=1
print (arr.count(m))


Fixed submission:
n, m = map(int,input().split())
arr = [1, n]
check = True
for i in range(m):
    l, r = map(int, input().split())
    if l <= arr[0] and r>= arr[1]:
        continue
    elif l > arr[1] or r < arr[0]:
        check = False
    if arr[0] <= l and l <= arr[1]:
        arr[0] = l
    if arr[1] >= r and r >= arr[0]:
        arr[1] = r
if check:
    print (arr[1] - arr[0] + 1)
else:
    print (0)
Buggy python submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
s = input()

def findmax(s,k):
    if len(s) == 1:
        return 1
    begin = s[0]
    l = [0]
    cur = 0
    for i in range(len(s)):
        if s[i]==begin:
            l[cur]+=1
        else:
            if begin == '0' : begin ='1'
            else: begin = '0'
            cur+=1
            l.append(1)
    r = 0
    if s[0] == '0':
        l = [0] + l
        r = 2*k
    else:
        r = 2*k+1
    sumup = [0]
    for i in range(len(l)):
        sumup.append(sumup[i]+l[i])
    return (max([sumup[i+r]-sumup[i] for i in range(0,len(sumup)-r,2)]))
print (findmax(s,k))

Fixed submission:
from itertools import accumulate

n, k = list(map(int,input().split(" ")))
s = input()


def findmax():
    cur=0
    l=[]
    prev = '1'
    for c in s:
        if prev ==c:
            cur+=1
        else:
            l.append(cur)
            cur = 1
        prev=c
    l.append(cur)
    if prev=='0':
        l.append(0)
    w = 2*k+1
    if len(l)<=w:
        return n
    sumup = [0]+list(accumulate(l))
    res = 0
    for i in range(0, len(l)-w+1,2):
        res = max(res,sumup[i+w]-sumup[i])
    return res
print(findmax())

Buggy python submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
s = input()

def findmax(s,k):
    if len(s) == 1:
        return 1
    begin = s[0]
    l = [0]
    cur = 0
    for i in range(len(s)):
        if s[i]==begin:
            l[cur]+=1
        else:
            if begin == '0' : begin ='1'
            else: begin = '0'
            cur+=1
            l.append(1)
    r = 0
    if s[0] == '0':
        l = [0] + l
        r = 2*k
    else:
        r = 2*k+1
    sumup = [0]
    for i in range(len(l)):
        sumup.append(sumup[i]+l[i])
    return (max([sumup[i+r]-sumup[i] for i in range(len(sumup)-r)]))
print (findmax(s,k))

Fixed submission:
from itertools import accumulate

n, k = list(map(int,input().split(" ")))
s = input()


def findmax():
    cur=0
    l=[]
    prev = '1'
    for c in s:
        if prev ==c:
            cur+=1
        else:
            l.append(cur)
            cur = 1
        prev=c
    l.append(cur)
    if prev=='0':
        l.append(0)
    w = 2*k+1
    if len(l)<=w:
        return n
    sumup = [0]+list(accumulate(l))
    res = 0
    for i in range(0, len(l)-w+1,2):
        res = max(res,sumup[i+w]-sumup[i])
    return res
print(findmax())
Buggy python submission (verdict: Time Limit Exceeded):
x,y,z,k = map(int, input().split())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))

sumAB = sorted([ai + bi for ai in a for bi in b],reverse=True)
sumABC = sorted([ci + abi for ci in c for abi in sumAB],reverse = True)

for i in range(k):
    print(sumABC[i])

Fixed submission:
x,y,z,k = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)

sumAB = sorted([ai + bi for ai in a for bi in b],reverse=True)[:k]
sumABC = sorted([ci + abi for ci in c for abi in sumAB],reverse = True)[:k]

for i in range(k):
    print(sumABC[i])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
x,y,z,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = []
for r in itertools.product(a,b,c):
    ans.append(r[0] + r[1] + r[2])
ans.sort()
for i in range(k):
    print(ans[-i-1])

Fixed submission:
x,y,z,k = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)

sumAB = sorted([ai + bi for ai in a for bi in b],reverse=True)[:k]
sumABC = sorted([ci + abi for ci in c for abi in sumAB],reverse = True)[:k]

for i in range(k):
    print(sumABC[i])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int,input().split())
if (a == b) and (b == c):
  print ("Yes")
 else:
  print ("No")

Fixed submission:
a, b, c = map(int,input().split())
if (a == b) and (b == c):
  print ("Yes")
else:
  print ("No")
Buggy python submission (verdict: Runtime Error):
b = input()
if b=='A':
    print ('T')
elif b = 'T':
    print ('A')
elif b = ('C'):
    print ('G')
else:
    print ('C')

Fixed submission:
b = input()
if b=='A':
    print ('T')
elif b == 'T':
    print ('A')
elif b == ('C'):
    print ('G')
else:
    print ('C')
Buggy python submission (verdict: Time Limit Exceeded):
def count(s):
    res = 0
    for i in range(len(s)-1):
        if s[i] == 'A':
            if s[i+1] == 'C':
                res+=1
    return res
n, q = map(int, input().split())
s = input()
for i in range(q):
    l, r = map(int,input().split())
    print (count(s[l-1:r]))


Fixed submission:
n, q = map(int, input().split())
s = input()
counts = [0 for i in range(n)]
count = 0

for i in range(n):
    if s[i-1:i+1] == 'AC':
        count+=1
    counts[i] = count


for i in range(q):
    l, r = map(int,input().split())
    print (counts[r-1] - counts[l-1])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
if a == c or a == d or b == c or b == d:
    print("YES")
else:
    print("NO")

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: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

hyoten = [1]*(n-k+1)
for i in range(n-k+1):
    for j in range(i, i+k):
        hyoten[i] *= a[j]

for i in range(n-k):
    if hyoten[i+1] > hyoten[i]:
        print("Yes")
    else:
        print("No")


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

for i in range(n-k):
    if a[i] < a[i+k]:
        print("Yes")
    elif a[i] >= a[i+k]:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))

hyoten = [1]*(n-k+1)
for i in range(n-k+1):
    for j in range(i, i+k):
        hyoten[i] *= a[j]

for i in range(n-k):
    if hyoten[i+1] > hyoten[i]:
        print("Yes")
    else:
        print("No")


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

for i in range(n-k):
    if a[i] < a[i+k]:
        print("Yes")
    elif a[i] >= a[i+k]:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

import itertools

comb = list(itertools.combinations(p, k))

ans = 100000000
for i in range(len(comb)):
    ans = min(ans, sum(comb[i]))

print(ans)
    

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

print(sum(p[0:k]))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

import itertools

comb = list(itertools.combinations(p, k))

ans = 100000000000
for i in range(len(comb)):
    ans = min(ans, sum(comb[i]))

print(ans)
    

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

print(sum(p[0:k]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
A = [0]*100000

for i in a:
    A[i] += 1
    
ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    ans = ans+((c-b)*(A[b]))
    print(ans)
    A[c] += A[b]
    A[b] = 0


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
A = [0]*1000000

for i in a:
    A[i] += 1
    
ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    ans = ans+((c-b)*(A[b]))
    print(ans)
    A[c] += A[b]
    A[b] = 0

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
A = [0]*100000

for i in a:
    A[i] += 1
    
ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    ans = ans+((c-b)*(A[b]))
    print(ans)
    A[c] += A[b]
    A[b] = 0


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
A = [0]*1000000

for i in a:
    A[i] += 1
    
ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    ans = ans+((c-b)*(A[b]))
    print(ans)
    A[c] += A[b]
    A[b] = 0

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())

for i in range(q):
    b, c = map(int, input().split())
    for j in range(n):
        if a[j] == b:
            a[j] = c
    print(sum(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
A = [0]*1000000

for i in a:
    A[i] += 1
    
ans = sum(a)

for i in range(q):
    b, c = map(int, input().split())
    ans = ans+((c-b)*(A[b]))
    print(ans)
    A[c] += A[b]
    A[b] = 0
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()
    
ans = 1
for i in a:
    ans *= i
    
if ans <= 1000000000000000000:
    print(ans)
else:
    print(-1)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()
    
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in a:
    ans *= i
    
if ans <= 1000000000000000000:
    print(ans)
else:
    print(-1)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()
    
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = input().split()
a = [int(i) for i in A]
b = [0]*n

for i in range(len(a)):
    for j in range(n):
        if j == a[i]:
            b[j-1] += 1

for i in range(n):
    print(b[i])

Fixed submission:
n = int(input())
A = input().split()
a = [int(i) for i in A]
b = [0]*n

for i in range(len(a)):
    s = a[i]
    b[s-1] += 1

for i in range(n):
    print(b[i])
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
import math

a = 0
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            a = math.gcd(i, j)
            ans = ans + math.gcd(a, k)
            
print(ans)
            

Fixed submission:
k = int(input())
import math
 
a = 0
ans = 0
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            a = math.gcd(i, j)
            ans = ans + math.gcd(a, k)
            
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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

ans = 0
for i in range(9):
    for j in range(9):
        if n%num[i] == 0 and n%num[j] == o and n//(num[i]) == num[j]:
            ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())

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

ans = 0
for i in range(9):
    for j in range(9):
        if n%num[i] == 0 and n%num[i] == 0 and n//(num[i]) == num[j]:
            ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int, input().split()))

import itertools
import numpy

a = []
for pair in itertools.combinations(d, 2):
    a.append(numpy.prod(pair))

print(sum(a))

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

import itertools
import numpy

a = []
for pair in itertools.combinations(d, 2):
    a.append(numpy.prod(pair))

print(sum(a))
Buggy python submission (verdict: Runtime Error):
s = input()

tenki = ["Sunny", "Cloudy", "Rainy"]
i = tenki.index(s)
i = (i%3)+1
print(tenki[i])
       

Fixed submission:
s = input()

if s == "Sunny":
    print("Cloudy")
if s == "Cloudy":
    print("Rainy")
if s == "Rainy":
    print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
tokuten = [k-q]*n

for i in range(q):
    a = int(input())
    for i in range(n):
        if i == a-1:
            tokuten[i] += 1


for i in range(n):
    if tokuten[i] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n, k, q = map(int, input().split())
tokuten = [k-q]*n

for i in range(q):
    a = int(input())
    tokuten[a-1] += 1


for i in range(n):
    if tokuten[i] <= 0:
        print("No")
    else:
        print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
tokuten = [k]*n

for i in range(q):
    a = int(input())
    for j in range(n):
        if j != a-1:
            tokuten[j] -= 1

for i in range(n):
    if tokuten[i] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
n, k, q = map(int, input().split())
tokuten = [k-q]*n

for i in range(q):
    a = int(input())
    tokuten[a-1] += 1


for i in range(n):
    if tokuten[i] <= 0:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

ans = [0]*n
for i in range(n):
    for j in range(i, n-1):
        if h[j] >= h[j+1]:
            ans[i] += 1
        else:
            break
print(max(ans))


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

cnt = 0
ans = 0
for i in range(n-1):
        if h[i] >= h[i+1]:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
print(max(ans, cnt))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)

ue = lcm(a[0], a[1])
if n >= 3:
    for i in range(2, n):
        ue = lcm(ue, a[i])

shita = 0
for i in range(len(a)):
    shita += ue//a[i]

ans = ue / shita
print(f"{ans:.6f}")


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

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)
if n >=2:
    ue = lcm(a[0], a[1])
    if n >= 3:
        for i in range(2, n):
            ue = lcm(ue, a[i])
else:
    ue = a[0]

shita = 0
if n >=2:
    for i in range(len(a)):
        shita += ue//a[i]
else:
    shita = n

ans = ue / shita
print(f"{ans:.6f}")

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)

ue = lcm(a[0], a[1])
if n >= 3:
    for i in range(2, n):
        ue = lcm(ue, a[i])

shita = 0
for i in range(len(a)):
    shita += ue//a[i]

ans = ue / shita
print(f"{ans:.6f}")


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

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)
if n >=2:
    ue = lcm(a[0], a[1])
    if n >= 3:
        for i in range(2, n):
            ue = lcm(ue, a[i])
else:
    ue = a[0]

shita = 0
if n >=2:
    for i in range(len(a)):
        shita += ue//a[i]
else:
    shita = n

ans = ue / shita
print(f"{ans:.6f}")
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())

x = a + b
y = a - b
z = a*b

if x != y and y != z and x != z:
    if x > y and x > z:
        print(x)
    else:
        if y > z:
            print(y)
        else:
            print(z)
if x == y and y ==  Z and x == Z:
    print(x, y, z)
else:
    pass
if x == y and x != Z:
    if x > z:
        print(x, y)
    else:
        print(z)
else:
    pass
if y == z and y != x:
    if y > x:
        print(y, z)
    else:
        print(x)
else:
    pass
if x == z and x != y:
    if x > y:
        print(x, z)
    else:
        print(z)
else:
    pass


Fixed submission:
a, b = map(int,input().split())

x = a + b
y = a - b
z = a*b

retsu = [x, y, z]
print(max(retsu))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

if a >= 13:
    ans = b
if 6 <= a < 13:
    ans = b//2
if a < 5:
    ans = 0
print(ans)

Fixed submission:
a, b = map(int, input().split())

if a >= 13:
    ans = b
if 6 <= a and a < 13:
    ans = b//2
if a < 6:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
	N,K = map(int,input().split())
	H = [int(h) for h in input().split()]
	H = sorted(H,reverse=True)
	for i in range(K):
		H[i] = 0
	print(sum(H))
if __name__ == '__main__':
	main()

Fixed submission:
def main():
	N,K = map(int,input().split())
	H = [int(h) for h in input().split()]
	H = sorted(H,reverse=True)
	for i in range(min(K,N)):
		H[i] = 0
	print(sum(H))
if __name__ == '__main__':
	main()