Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,M,K=list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
AA=[0]*(N+1)
BB=[0]*(M+1)
A3=0
B3=0
high=0
for i in range(0,N):
    A3+=A[i]
    AA[i+1]=A3
for j in range(0,M):
    B3+=B[j]
    BB[j+1]=B3
for i in range(0,N+1):
    for j in range(0,M+1):
        if AA[i]+BB[j]<=K and high<i+j:
            high=i+j
print(high)

Fixed submission:
N,M,K=list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
AA=[0]*(N+1)
BB=[0]*(M+1)
A3=0
B3=0
high=0
for i in range(0,N):
    A3+=A[i]
    AA[i+1]=A3
for j in range(0,M):
    B3+=B[j]
    BB[j+1]=B3
for i in range(0,N+1):
    if AA[i]>K:
        break
    while True:
        if BB==[]:
            break
        elif BB==[0]:
            BB=[]
            break
        elif AA[i]+BB[-1]>K:
            BB.pop(-1)
        else:
            break
    if BB!=[]:
        time=AA[i]+BB[-1]
        judge=1
    else:
        time=AA[i]
        judge=0
    if time<=K:
        if judge==0:
            if high<i:
                high=i
        else:
            if high<i+len(BB)-1:
                high=i+len(BB)-1
print(high)

Buggy python submission (verdict: Runtime Error):
N,M,K=list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
count=0
while True:
    if A[0]<=B[0] or B==[]:
        count+=1
        K-=A.pop(0)
    else:
        count+=1
        K-=B.pop(0)

    if K<0:
        count-=1
        break

    if A==[] and B==[]:
        break
print(count)

Fixed submission:
N,M,K=list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
AA=[0]*(N+1)
BB=[0]*(M+1)
A3=0
B3=0
high=0
for i in range(0,N):
    A3+=A[i]
    AA[i+1]=A3
for j in range(0,M):
    B3+=B[j]
    BB[j+1]=B3
for i in range(0,N+1):
    if AA[i]>K:
        break
    while True:
        if BB==[]:
            break
        elif BB==[0]:
            BB=[]
            break
        elif AA[i]+BB[-1]>K:
            BB.pop(-1)
        else:
            break
    if BB!=[]:
        time=AA[i]+BB[-1]
        judge=1
    else:
        time=AA[i]
        judge=0
    if time<=K:
        if judge==0:
            if high<i:
                high=i
        else:
            if high<i+len(BB)-1:
                high=i+len(BB)-1
print(high)
Buggy python submission (verdict: Runtime Error):
import math
A,B=list(map(str,input().split()))
A=int(A)
B.replace('.','')
C=int(B)
D=A*C
if D<100:
    print(0)
    exit()
D=str(D)
print(D[0:-2])

Fixed submission:
import decimal
import math
A,B=list(map(decimal.Decimal,input().split()))
C=decimal.Decimal(A*B)
print(math.floor(C))
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
i=0
while True:
    x1=(X+i**5)**(1/5)
    x2=(X-i**5)**(1/5)
    if x1==int(x1):
        print(int(x1),i)
        exit()
    elif isinstance(x2,complex):
        i=i
    elif x2==int(x2):
        print(int(x2),-i)
        exit()
    i+=1

Fixed submission:
X=int(input())
J=1000
N=[0]*J
for i in range(0,J):
    N[i]=i**5
for i in range(0,J):
    for j in range(0,J):
        if abs(N[i]-N[j])==X:
            print(int(max(N[i],N[j])**(1/5)),int(min(N[i],N[j])**(1/5)))
            exit()
        elif N[i]+N[j]==X:
            print(int(N[i]**(1/5)),int(-1*N[j]**(1/5)))
            exit()

Buggy python submission (verdict: Runtime Error):
X=int(input())
i=0
while True:
    x1=(X+i**5)**(1/5)
    x2=(X-i**5)**(1/5)
    if x1==int(x1):
        print(int(x1),i)
        exit()
    elif x2==int(x2):
        print(int(x2),-i)
        exit()
    i+=1

Fixed submission:
X=int(input())
J=1000
N=[0]*J
for i in range(0,J):
    N[i]=i**5
for i in range(0,J):
    for j in range(0,J):
        if abs(N[i]-N[j])==X:
            print(int(max(N[i],N[j])**(1/5)),int(min(N[i],N[j])**(1/5)))
            exit()
        elif N[i]+N[j]==X:
            print(int(N[i]**(1/5)),int(-1*N[j]**(1/5)))
            exit()
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
B=[0]+A
for i in range(0,len(B)):
    print(B.count(i+1))

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
import collections
B=collections.Counter(A)
for i in range(0,N):
    print(B[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
import math
K=int(input())+1
goke=0
for i in range(1,K):
    for j in range(1,K):
        for k in range(1,K):
            goke=goke+math.gcd(math.gcd(i,j),k)
print(goke)

Fixed submission:
import math
K=int(input())+1
goke=0
for i in range(1,K):
    for j in range(i,K):
        for k in range(j,K):
            if i==j and i==k:
                goke=goke+i
            elif (i==j and i<k) or (i<j and j==k):
                goke=goke+3*math.gcd(i,k)
            else:
                goke=goke+6*math.gcd(math.gcd(i,j),k)
print(goke)
Buggy python submission (verdict: Runtime Error):
N,A,B= list(map(int, input().split()))
if N*A>=B:
    print(B)
else
    print(N*A)

Fixed submission:
N,A,B= list(map(int, input().split()))
if N*A>=B:
    print(B)
else:
    print(N*A)
Buggy python submission (verdict: Time Limit Exceeded):
import statistics
N=int(input())
X=list(map(int, input().split()))
for i in range(0,N):
    print(statistics.median(X[:i]+X[i+1:]))

Fixed submission:
N=int(input())
X=list(map(int, input().split()))
sortX=sorted(X)
small=sortX[int(N/2)-1]
big=sortX[int(N/2)]
if small==big:
    for i in range(0,N):
        print(small)
    exit()

for i in range(0,N):
    if X[i]>small:
        print(small)
    else:
        print(big)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
yoso=list(set(a))
count=0
for i in range(0,len(yoso)):
    acount=a.count(yoso[i])
    if yoso[i]>acount:
        count+=acount
    elif yoso[i]<acount:
        count+=(acount-yoso[i])
print(count)

Fixed submission:
import collections
N=int(input())
a=list(map(int,input().split()))
b=collections.Counter(a)
c=list(set(a))
count=0
for i in range(0,len(c)):
    if b[c[i]]>=c[i]:
        count+=b[c[i]]-c[i]
    else:
        count+=b[c[i]]
print(count)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
b4=[x for x in a if x%4==0]
a4=[x for x in a if x%4!=0]
b2=[x for x in a4 if x%2==0]
c=[x for x in a4 if x%2!=0]
if len(b4)==0 and (len(c)==0 and len(b2)>1):
    print('Yes')
elif len(b4)==0 and len(c)!=0
    print('No')
elif len(b4)+1<len(c):
    print('No')
elif len(b4)<len(c) and len(b2)>0:
    print('No')
else:
    print('Yes')

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
b4=[x for x in a if x%4==0]
a4=[x for x in a if x%4!=0]
b2=[x for x in a4 if x%2==0]
c=[x for x in a4 if x%2!=0]
if len(b4)==0 and (len(c)==0 and len(b2)>1):
    print('Yes')
elif len(b4)==0 and len(c)!=0:
    print('No')
elif len(b4)+1<len(c):
    print('No')
elif len(b4)<len(c) and len(b2)>0:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
#ABC169b

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

sum = 1

for i in range(n):
    sum = sum * a[i]

if sum > 10**18:
    print(-1)
else:
    print(sum)


Fixed submission:
#ABC169b

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

sum = 1

if 0 in a:
    sum = 0
else:
    for i in range(n):
        sum = sum * a[i]
        if sum > 10**18:
            break

if sum > 10**18:
    print(-1)
else:
    print(sum)
Buggy python submission (verdict: Runtime Error):
#ABC168

n = int(input())

unit = {0:'pon', 1:'pon', 2:'hon', 3:'bon', 4:'hon', 5:'hon', 6:'pon', 7:'hon', 8:'pon', 9:'hon'}

x = n % 10
print(unit[x])


Fixed submission:
#ABC167-A

id_1 = input()
id_2 = input()

length_1 = len(id_1)
length_2 = len(id_2)

if length_2 == length_1 + 1 and id_2.startswith(id_1):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
d = {n: 'hon' for n in "24579"}
d.update({n: 'pon' for n in "0168"})
d.update({3: 'bon'})

print(d[input()[-1]])


Fixed submission:
d = {n: 'hon' for n in "24579"}
d.update({n: 'pon' for n in "0168"})
d.update({"3": 'bon'})
 
print(d[input()[-1]])
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = sorted(map(int, input().split()))
q = sorted(map(int, input().split()))
r = sorted(map(int, input().split()))
v = 0

for _ in range(x):
    if len(r):
        if p[-1] > r[-1]:
            v += p.pop()
        else:
            v += r.pop()
    else:
        v += p.pop()

for _ in range(y):
    if len(r):
        if q[-1] > r[-1]:
            v += q.pop()
        else:
            v += r.pop()
    else:
        v += r.pop()

print(v)


Fixed submission:
x, y, a, b, c = map(int, input().split())
p = sorted(map(int, input().split()), reverse=True)
q = sorted(map(int, input().split()), reverse=True)
r = sorted(map(int, input().split()))
v = 0
c = sorted(p[0:x] + q[0:y])
for i in range(x + y):
    if len(r):
        if c[i] < r[-1]:
            c[i] = r.pop()
    else:
        break
print(sum(c))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0

tmp = 0
for i in range(n):
    tmp += sum(range(1, p[i] + 1)) / p[i]
    if i >= k:
        tmp -= sum(range(1, p[i - k] + 1)) / p[i - k]
    ans = max(ans, tmp)

print(ans)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
e = [sum(range(1, pi + 1)) / pi for pi in p]

tmp = 0
for i in range(n):
    tmp += e[i]
    if i >= k:
        tmp -= e[i - k]
    ans = max(ans, tmp)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
e = [sum(range(1, pi + 1)) / pi for pi in p]

tmp = 0
for i in range(n):
    tmp += e[i]
    if i >= k:
        tmp -= e[i - k]
    ans = max(ans, tmp)

print(ans)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
e = [sum(range(1, pi + 1)) / pi for pi in p]

tmp = 0
for i in range(n):
    tmp += e[i]
    if i >= k:
        tmp -= e[i - k]
    ans = max(ans, tmp)

print(ans)

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

for i in range(n - k + 1):
    e = 0
    for pi in p[i:i + k]:
        e += sum(range(1, pi + 1)) / pi
    ans = max(e, ans)
print(ans)


Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
e = [sum(range(1, pi + 1)) / pi for pi in p]

tmp = 0
for i in range(n):
    tmp += e[i]
    if i >= k:
        tmp -= e[i - k]
    ans = max(ans, tmp)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n = int(input())
s = input()
c = set()

for sc in combinations(map(int, list(s)), 3):
    c.add(sc)

print(len(c))



Fixed submission:
from itertools import product

n = int(input())
s = input()

ans = 0

for cmb in product(range(10), range(10), range(10)):
    idx = -1
    for i in cmb:
        idx = s.find(str(i), idx + 1)
        if idx < 0:
            break
    else:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n = int(input())
s = input()

c = set()

for sc in combinations(s, 3):
    c.add(sc)

print(len(c))


Fixed submission:
from itertools import product

n = int(input())
s = input()

ans = 0

for cmb in product(range(10), range(10), range(10)):
    idx = -1
    for i in cmb:
        idx = s.find(str(i), idx + 1)
        if idx < 0:
            break
    else:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = input()

c = set()

for sc in combinations(s, 3):
    c.add(sc)

print(len(c))



Fixed submission:
from itertools import product

n = int(input())
s = input()

ans = 0

for cmb in product(range(10), range(10), range(10)):
    idx = -1
    for i in cmb:
        idx = s.find(str(i), idx + 1)
        if idx < 0:
            break
    else:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
arr = ['NONE', 'SAT', ' FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
s = input()
print(arr.index(s))


Fixed submission:
arr = ['NONE', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
s = input()
print(arr.index(s))

Buggy python submission (verdict: Runtime Error):
arr = ['NONE', 'SAT', ' FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
s = input()
print(arr.index(s))


Fixed submission:
arr = ['NONE', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
s = input()
print(arr.index(s))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

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

a = sorted(a)
f = sorted(f, reverse=True)

def judge(n):
    s = 0
    for x, y in zip(a, f):
        s += max(0, x - n // y)
    if s <= k:
        return True
    else:
        return False

low = 0
high = a[-1] * f[0]
while high - low > 0:
    mid = (high + low) // 2
    if judge(mid):
        high = mid
    else:
        low = mid + 1
print(high)

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

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

a = sorted(a)
f = sorted(f, reverse=True)

def judge(n):
    s = 0
    for x, y in zip(a, f):
        s += max(0, x - n // y)
    if s <= k:
        return True
    else:
        return False

low = 0
high = a[-1] * f[0]
while high - low > 0:
    mid = (high + low) // 2
    if judge(mid):
        high = mid
    else:
        low = mid + 1
print(high)

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

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

a = sorted(a)
f = sorted(f, reverse=True)

score = sorted(((x * y, x, y) for (x, y) in zip(a, f)))
for _ in range(k):
    p, x, y = score.pop()
    if x > 0:
        x -= 1
    bisect.insort(score, (x * y, x, y))

p, _, _ = score.pop()
print(p)



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

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

a = sorted(a)
f = sorted(f, reverse=True)

def judge(n):
    s = 0
    for x, y in zip(a, f):
        s += max(0, x - n // y)
    if s <= k:
        return True
    else:
        return False

low = 0
high = a[-1] * f[0]
while high - low > 0:
    mid = (high + low) // 2
    if judge(mid):
        high = mid
    else:
        low = mid + 1
print(high)

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

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

a = sorted(a)
f = sorted(f, reverse=True)

score = sorted(((x * y, x, y) for (x, y) in zip(a, f)))
for _ in range(k):
    p, x, y = score.pop()
    if x > 0:
        x -= 1
    bisect.insort(score, (x * y, x, y))

p, _, _ = score.pop()
print(p)




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

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

a = sorted(a)
f = sorted(f, reverse=True)

def judge(n):
    s = 0
    for x, y in zip(a, f):
        s += max(0, x - n // y)
    if s <= k:
        return True
    else:
        return False

low = 0
high = a[-1] * f[0]
while high - low > 0:
    mid = (high + low) // 2
    if judge(mid):
        high = mid
    else:
        low = mid + 1
print(high)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

ans = 0
for left in range(n - 1):
    right = left + 1
    length = 0
    while right < n and h[right - 1] >= h[right]:
        length += 1
        right += 1
    ans = max(ans, length)
print(ans)


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

dp = [0] * n
dp[0] = 0
ans = 0
for i in range(1, n):
    if h[i - 1] >= h[i]:
        if dp[i - 1] == 0:
            dp[i] = 1
        else:
            dp[i] = dp[i - 1] + 1
        ans = max(dp[i], ans)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from itertools import combinations

n = int(input())

counters = []
for _ in range(n):
    counters.append(Counter(input().rstrip()))

ans = 0
for c1, c2 in combinations(counters, 2):
    ck1 = sorted(c1.keys())
    ck2 = sorted(c2.keys())
    if len(ck1) != len(ck2):
        continue
    for k1, k2 in zip(ck1, ck2):
        if k1 != k2:
            break
        elif c1[k1] != c2[k2]:
            break
    else:
        ans += 1

print(ans)

Fixed submission:
from collections import Counter

n = int(input())
ans = 0
k = set()
c = Counter()

for _ in range(n):
    s = ''.join(sorted(list(input().rstrip())))
    if s in k:
        c[s] += 1
    k.add(s)

ans = 0
for ck in c.keys():
    ans += c[ck] * (c[ck] + 1) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from itertools import combinations

n = int(input())

counters = []
for _ in range(n):
    counters.append(Counter(input().rstrip()))

ans = 0
for c1, c2 in combinations(counters, 2):
    ck1 = sorted(c1.keys())
    ck2 = sorted(c2.keys())
    if len(ck1) != len(ck2):
        continue
    for k1, k2 in zip(ck1, ck2):
        if k1 != k2:
            break
        elif c1[k1] != c2[k2]:
            break
    else:
        ans += 1

print(ans)

Fixed submission:
from collections import Counter

n = int(input())
ans = 0
k = set()
c = Counter()

for _ in range(n):
    s = ''.join(sorted(list(input().rstrip())))
    if s in k:
        c[s] += 1
    k.add(s)

ans = 0
for ck in c.keys():
    ans += c[ck] * (c[ck] + 1) // 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input().rstrip())
n = len(s)
m = 10 ** 9 + 7
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]
        for j in range(13):
            dp[i + 1][j] %= m
print(dp[n][5])


Fixed submission:
s = list(input().rstrip())
n = len(s)
m = 10 ** 9 + 7
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]
        for j in range(13):
            dp[i + 1][j] %= m
print(dp[n][5])

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input().rstrip())
n = len(s)
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]
        for j in range(13):
            dp[i + 1][j] %= 10 ** 9 + 7
print(dp[n][5])


Fixed submission:
s = list(input().rstrip())
n = len(s)
m = 10 ** 9 + 7
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]
        for j in range(13):
            dp[i + 1][j] %= m
print(dp[n][5])

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input().rstrip())
n = len(s)
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]

print(dp[n][5] % (10**9 + 7))


Fixed submission:
s = list(input().rstrip())
n = len(s)
m = 10 ** 9 + 7
dp = [[0] * 13 for _ in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    c = -1 if s[i] == '?' else int(s[i])
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki]
        for j in range(13):
            dp[i + 1][j] %= m
print(dp[n][5])
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_right

n = int(input())
a = [int(input()) for _ in range(n)]

c = []
c.append(a[0])
for ai in a[1:]:
    ci = bisect_right(c, ai)
    if ci == 0 or c[ci - 1] == ai:
        c.append(ai)
        c.sort()
    else:
        c[ci - 1] = ai
        c.sort()

print(len(c))


Fixed submission:
from bisect import bisect_left

n = int(input())
a = [int(input()) for _ in range(n)]

c = [0] * n
end = n

for ai in a:
    ci = bisect_left(c, ai, end, n)
    c[ci - 1] = ai
    if ci <= end:
        end -= 1
print(n - end)
Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())


if x == 0 and y == 0:
    s1 = h * w / 2
    s1 = s2
else:
    ym = min(y, h - y)
    xm = min(x, w - x)

    s1 = ym * w
    s2 = xm * h
    s = max(s1, s2)

o = 0
if s1 == s2:
    o = 1
print("{:.6f} {}".format(s, o))


Fixed submission:
w, h, x, y = map(int, input().split())

print("{:.10f} {}".format(w * h / 2, 1 if x * 2 == w and y * 2 == h else 0))
Buggy python submission (verdict: Runtime Error):
from itertools import permutations
from collections import Counter


n = int(input())
balls = []

for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

counter = Counter()
for b1, b2 in permutations(balls, 2):
    p, q = b1[0] - b2[0], b1[1] - b2[1]
    counter[(p, q)] += 1

(p, q), val = counter.most_common(1)[0]
print(n - val)


Fixed submission:
from itertools import permutations
from collections import Counter


n = int(input())
balls = []

for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

if n == 1:
    print(1)
else:
    counter = Counter()
    for b1, b2 in permutations(balls, 2):
        p, q = b1[0] - b2[0], b1[1] - b2[1]
        counter[(p, q)] += 1

    (p, q), val = counter.most_common(1)[0]
    print(n - val)

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


n = int(input())
balls = []
cost = n
for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

counter = Counter()
for b1, b2 in permutations(balls, 2):
    p, q = b1[0] - b2[0], b1[1] - b2[1]
    counter[(p, q)] += 1

(p, q), val = counter.most_common(1)[0]
print(n - val)

Fixed submission:
from itertools import permutations
from collections import Counter


n = int(input())
balls = []

for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

if n == 1:
    print(1)
else:
    counter = Counter()
    for b1, b2 in permutations(balls, 2):
        p, q = b1[0] - b2[0], b1[1] - b2[1]
        counter[(p, q)] += 1

    (p, q), val = counter.most_common(1)[0]
    print(n - val)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
diffs = []
xi, yi = map(int, input().split())
for _ in range(n - 1):
    xn, yn = map(int, input().split())
    diffs.append((xi - xn, yi - yn))
    xi, yi = xn, yn

c = Counter(diffs)
cv = c.most_common(1)
(p, q), val = c.most_common(1)[0]
print(n - val)




Fixed submission:
from itertools import permutations
from collections import Counter


n = int(input())
balls = []

for _ in range(n):
    x, y = map(int, input().split())
    balls.append((x, y))

if n == 1:
    print(1)
else:
    counter = Counter()
    for b1, b2 in permutations(balls, 2):
        p, q = b1[0] - b2[0], b1[1] - b2[1]
        counter[(p, q)] += 1

    (p, q), val = counter.most_common(1)[0]
    print(n - val)
Buggy python submission (verdict: Time Limit Exceeded):
from decimal import Decimal

n, k = map(int, input().split())
sum = Decimal(0.0)
for i in range(1, n + 1):
    p = Decimal(1.0 / n)
    score = i
    while score < k:
        score = score * 2
        p = p * Decimal(0.5)
    sum += p
print(str(sum)[:14])


Fixed submission:
n, k = map(int, input().split())
sum = 0.0
for i in range(1, n + 1):
    p = 1.0 / n
    score = i
    while score < k:
        score = score * 2
        p = p * 0.5
    sum += p
print(sum)