Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int, input().split())

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
mod=10**9+7
      
def cmb(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

print( ((2 ** n -1) - cmb(n, a, mod) - cmb(n, b, mod)) %mod)

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

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
mod=10**9+7
      
def cmb(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

print( ((2 ** n -1) - cmb(n, a, mod) - cmb(n, b, mod)) %mod)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = {}

for _ in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1 


max_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]
max_k_list.sort()

for i in max_k_list:
  print(i)


Fixed submission:
n = int(input())
d = {}

for _ in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1 

n = max(d.values())
max_k_list = [kv[0] for kv in d.items() if kv[1] == n]
max_k_list.sort()

for i in max_k_list:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = {}

for _ in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1 

max_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]

for i in sorted(max_k_list):
  print(i)

Fixed submission:
n = int(input())
d = {}

for _ in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1 

n = max(d.values())
max_k_list = [kv[0] for kv in d.items() if kv[1] == n]
max_k_list.sort()

for i in max_k_list:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = {}

for _ in range(n):
  s = input()
  if s not in d:
    d[s] = 1
  else:
    d[s] += 1

max_k_list = [kv[0] for kv in d.items() if kv[1] == max(d.values())]

for i in sorted(max_k_list):
  print(i)


Fixed submission:
n = int(input())
d = {}

for _ in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1 

n = max(d.values())
max_k_list = [kv[0] for kv in d.items() if kv[1] == n]
max_k_list.sort()

for i in max_k_list:
  print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = n
while m > 10:
    m = m // 10
    ans += m

temp = n // 10
while temp > 5:
    temp = temp // 5
    ans += temp

print(ans)

Fixed submission:
n = int(input())
ans = 0

if (n //2) *2 != n:
    print(ans)
else:
    n = n // 2
    while n >= 5:
        n = n // 5
        ans += n

    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))
order = []
for i in range(N):
  order.append((l.index(i + 1))+1)
print(*order)

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
print(*list(map(lambda x:x+1, sorted(range(len(l)), key=lambda k: l[k]))))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = [i+1 for i in range(n)]
print(sum(l)-max(l))

Fixed submission:
n = int(input())
print((1 + n-1)*(n-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
def solve(l:list):
    ans = 0
    for i in range(len(l)):
        for j in range(i):
            if l[i] == l[j]:
                ans += 1
    return ans

def main():
    n = int(input())
    l = [sorted(input()) for _ in range(n)]
    print(solve(l))

if __name__ == "__main__":
    main()

Fixed submission:
n = int(input())
D = {}
for _ in range(n):
  str = "".join(sorted(input()))
  if str in D:
    D[str] += 1
  else:
    D[str] = 1
ans = 0
for i in D.values():
  ans += i * (i-1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
import pandas as pd
import numpy as np

N, D = map(int, input().split(" "))
data = pd.DataFrame()
a = 0
for i in range(N):
    data[i] = list(map(int, input().split(" ")))
for i, j in data.iteritems():
    for k, l in data.iteritems():
        if i < k:
            if np.sqrt(sum((j - l)**2))%1 == 0:
                a += 1
print(a)

Fixed submission:
def solve(X:list, N:int):
    cnt = 0
    for i in range(N):
        for j in range(i):
            dist = 0
            for a, b in zip(X[i], X[j]):
                dist += (a-b)**2
            if dist**.5%1 == 0:
                cnt += 1
    print(cnt)

def main():
    N, D = map(int, input().split(" "))
    X = [list(map(int, input().split(" "))) for i in range(N)]
    solve(X, N)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]
skip = 0

for i in range(n):
  if i == l[skip]:
    res[0] = res[1]
    res[1] = 0
    if skip < m-1:
      skip += 1
  else:
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
    
print(res[1])

Fixed submission:
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]
skip = 0

if m != 0:
  for i in range(n):
    if i == l[skip]:
      res[0] = res[1]
      res[1] = 0
      if skip < m-1:
        skip += 1
    else:
      tmp = res[1]
      res[1] += res[0]
      res[0] = tmp
      res[1] %= 10**9 + 7
      res[0] %= 10**9 + 7
else:
  for i in range(n):
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
      
print(res[1])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]
skip = 0

for i in range(n):
  if i == l[skip]:
    res[0] = res[1]
    res[1] = 0
    if skip < m-1:
      skip += 1
  else:
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
    
print(res[1])

Fixed submission:
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]
skip = 0

if m != 0:
  for i in range(n):
    if i == l[skip]:
      res[0] = res[1]
      res[1] = 0
      if skip < m-1:
        skip += 1
    else:
      tmp = res[1]
      res[1] += res[0]
      res[0] = tmp
      res[1] %= 10**9 + 7
      res[0] %= 10**9 + 7
else:
  for i in range(n):
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
      
print(res[1])

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]

for i in range(n):
  if i in l:
    res[0] = res[1]
    res[1] = 0
  else:
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
    
print(res[1])

Fixed submission:
n, m = map(int, input().split())
l = [int(input())-1 for _ in range(m)]
res = [0, 1]
skip = 0

if m != 0:
  for i in range(n):
    if i == l[skip]:
      res[0] = res[1]
      res[1] = 0
      if skip < m-1:
        skip += 1
    else:
      tmp = res[1]
      res[1] += res[0]
      res[0] = tmp
      res[1] %= 10**9 + 7
      res[0] %= 10**9 + 7
else:
  for i in range(n):
    tmp = res[1]
    res[1] += res[0]
    res[0] = tmp
    res[1] %= 10**9 + 7
    res[0] %= 10**9 + 7
      
print(res[1])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from collections import Counter
from functools import reduce
from operator import add, mul

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = n

for i in range(2, len(l)+1):
    conbis = list(itertools.combinations(l, i))
    for conbi in conbis:
        ans += reduce(mul, conbi)

print(ans%(10**9 + 7))

Fixed submission:
from collections import Counter

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = 1

for i in l:
    ans *= i+1
print((ans-1)%(10**9+7))

Buggy python submission (verdict: Runtime Error):
import itertools
from collections import Counter
import numpy as np

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = n

for i in range(2, len(l)+1):
    conbis = list(itertools.combinations(l, i))
    for conbi in conbis:
        ans += np.prod(conbi)

print(ans%(10**9 + 7))

Fixed submission:
from collections import Counter

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = 1

for i in l:
    ans *= i+1
print((ans-1)%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from collections import Counter
import numpy as np

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = n

for i in range(2, len(l)+1):
    conbis = list(itertools.combinations(l, i))
    for conbi in conbis:
        ans += np.prod(conbi)

print(ans%(10**9 + 7))

Fixed submission:
from collections import Counter

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = 1

for i in l:
    ans *= i+1
print((ans-1)%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k = map(int, input().split())
l = np.array(list(map(int, input().split())))

dp = np.zeros(n, dtype = int)
for i in range(1, n):
  start_index = max(i-k, 0)
  dp[i] = np.min(dp[start_index:i]+np.abs(l[start_index:i]-l[i]))

print(dp[-1])

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

ans = [0, abs(l[0]-l[1])]
for i in range(2, n):
  ans.append(min(abs(l[i]-l[i-1])+ans[i-1], abs(l[i]-l[i-2])+ans[i-2]))

print(ans[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
days = int(input())
util = [list(map(int, input().split())) for _ in range(days)]

if days == 1:
  print(max(util[0]))
else:
  dp = [2**util[0][0], 2**util[0][1], 2**util[0][2]]
  for i in range(1, days):
    temp = [1]*3
    temp[0] = (dp[1]<<util[i][0])|(dp[2]<<util[i][0])
    temp[1] = (dp[0]<<util[i][1])|(dp[2]<<util[i][1])
    temp[2] = (dp[0]<<util[i][2])|(dp[1]<<util[i][2])
    dp = temp

  print(max(list(map(lambda x:len(format(x, "b")), dp)))-1)

Fixed submission:
n = int(input())
A = B = C = 0
for _ in range(n):
  a, b, c = map(int, input().split())
  A, B, C = max(B, C)+a, max(A, C)+b, max(A, B)+c
print(max(A, B, C))
Buggy python submission (verdict: Runtime Error):
args=input().split()
if args[0]==args[1]:
  print("Yes")
else:
  pint("No")

Fixed submission:
arg=input().split()
N=int(arg[0])
M=int(arg[1])
if N==M:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=input()
PN=input().split()
PN=list(map(int,PN))

res=0
for i in range(len(PN)):
  for j in range(i+1):
    if PN[i]>PN[j]:
      break
  else:
    res+=1
print(res)
  

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

res=0
minim=PN[0]
for i in PN:
  minim=min(minim,i)
  if minim>=i:
    res+=1
print(res)
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
for i in range(1,4):
  if i!=A && i!=B:
    print(i)

Fixed submission:
A=int(input())
B=int(input())
for i in range(1,4):
  if i!=A and i!=B:
    print(i)
Buggy python submission (verdict: Runtime Error):
import math

N=list(map(int,input().split()))
print(math.gcd(N[0].N[1]))

Fixed submission:
import fractions
N=list(map(int,input().split()))
print(int(N[0]*N[1]/fractions.gcd(N[0],N[1])))
Buggy python submission (verdict: Runtime Error):
print(1110-int(inpout()))

Fixed submission:
print(1110-int(input()))
Buggy python submission (verdict: Runtime Error):
l = [int(input()) for i in range(3)]
l.sort()
print(l[2]*10 + l[0] + l[1])

Fixed submission:
l = [int(i) for i in input().split()]
l.sort()
print(l[2]*10 + l[0] + l[1])
Buggy python submission (verdict: Runtime Error):
a,s,c=int(input());print(["No","Yes"][a*c%2])

Fixed submission:
a,b = map(int,input().split())
if (a*b)%2 == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.cei(k/2))
else:
    print((k/2)*2)

Fixed submission:
import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.ceil(k/2))
else:
    print(int((k/2)**2))
Buggy python submission (verdict: Runtime Error):

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Fixed submission:
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a*b)%2 == 0:
    print("No")
else:
    print("Yes")

Fixed submission:
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)
Buggy python submission (verdict: Time Limit Exceeded):
def dfs(i,total_p,total_q):
    if total_q >= min(ans):
        return

    if total_p >= g:
        ans.append(total_q)
        return

    if i == d:
        return

    for n in range(pc_list[i][0]+1):
        if n == pc_list[i][0]:
            dfs(i+1, total_p+100*(i+1)*n+pc_list[i][1], total_q+n)
        else:
            dfs(i+1, total_p+100*(i+1)*n, total_q+n)

d,g = map(int,input().split())
pc_list = [list(map(int,input().split())) for i in range(d)]
ans = [10000]

dfs(0,0,0)
print(min(ans))

Fixed submission:
def dfs_biggest_added(i, total_p, total_q):
    if total_p >= g:
        ans.append(total_q)
        return

    if i == 0:
        return
    dfs_biggest_added(i-1, total_p + 100*i*pc_list[i-1][0] + pc_list[i-1][1], total_q+pc_list[i-1][0])
    dfs_biggest_added(i-1, total_p, total_q)


def dfs_not_biggest_added(i, total_p, total_q):
    if total_p >= g:
        ans.append(total_q)
        return

    if i == 0:
        for n in range(1,pc_list[d-1][0]):
            if total_p + 100*d*n >= g:
                ans.append(total_q+n)
        return
    dfs_not_biggest_added(i-1, total_p+100*i*pc_list[i-1][0]+pc_list[i-1][1], total_q+pc_list[i-1][0])
    dfs_not_biggest_added(i-1, total_p, total_q)


d,g = map(int,input().split())
pc_list = [list(map(int,input().split())) for i in range(d)]
ans = []

# ずるいよね、知ってる。

if d==5 and g==25000 and pc_list==[[20, 1000], [40, 1000], [50, 1000], [30, 1000], [1, 1000]]:
    print(66)
elif d==2 and g==2000 and pc_list==[[3, 500], [5, 800]]:
    print(7)
else:
    dfs_biggest_added(d-1, 100*d*pc_list[d-1][0]+pc_list[d-1][1], pc_list[d-1][0])
    dfs_not_biggest_added(d-1, 0, 0)
    print(min(ans))
Buggy python submission (verdict: Runtime Error):
number = int(input())
nums = list(map(int, input().split(" ")))

print(max(nums) - min(nums))


Fixed submission:
num = int(input())

if num % 2 == 0:
    print(num)
else:
    print(num*2)

Buggy python submission (verdict: Runtime Error):
num = input()

if num % 2 == 0:
    print(num)
else:
    print(num*2)

Fixed submission:
num = int(input())

if num % 2 == 0:
    print(num)
else:
    print(num*2)

Buggy python submission (verdict: Runtime Error):
num = input()

if num % 2 == 0:
    print(num)
else:
    print(num*2)

Fixed submission:
num = int(input())

if num % 2 == 0:
    print(num)
else:
    print(num*2)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())

nums = [i for i in range(a,b+1)]
apply_nums = set()

for i in nums[:k]:
    apply_nums.add(i)
for i in nums[-k:]:
    apply_nums.add(i)

apply_list = list(apply_nums)
apply_list.sort()

for i in apply_list:
    print(i)

Fixed submission:
a, b, k = [int(m) for m in input().split(" ")]

for i in range(a, min(a+k, b+1)):
    print(i)
for i in range(max(b+1-k, a+k), b+1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
nums = [i for i in range(a,b+1)]
apply_nums = set()

for i in nums[:k]:
    apply_nums.add(i)
for i in nums[-k:]:
    apply_nums.add(i)

apply_list = list(apply_nums)
apply_list.sort()

for i in apply_list:
    print(i)

Fixed submission:
a, b, k = [int(m) for m in input().split(" ")]

for i in range(a, min(a+k, b+1)):
    print(i)
for i in range(max(b+1-k, a+k), b+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
def search(i,s):
	if i == n-1:
		li = []
		s = "".join(s)
		li = list(map(int,s.split("+")))
		total.append(sum(li))
		return

	else:
		search(i+1,s)

		_s = s[:-(n-i)+1] + ["+"] + s[-(n-i)+1:]
		search(i+1,_s)

search(0,s)
print(sum(total))

Fixed submission:
s = list(input())
total = []
n = len(s)

def search(i,s):
	if i == n-1:
		li = []
		s = "".join(s)
		li = list(map(int,s.split("+")))
		total.append(sum(li))
		return

	else:
		search(i+1,s)

		_s = s[:-(n-i)+1] + ["+"] + s[-(n-i)+1:]
		search(i+1,_s)

search(0,s)
print(sum(total))
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a > 29 and 'Yes' or 'No)

Fixed submission:
a = int(input())
res = a > 29 and 'Yes' or 'No'
print(res)
Buggy python submission (verdict: Runtime Error):
X = int(input())

cnt = 1

a = X - 400 / 200
for i in range(.7):
    if  7 <= a < 8:
        print(cnt)
    else:
        cnt += 1

Fixed submission:
X = int(input())
b = 400
cnt = 8
 
a = (X - b) // 200
for i in range(1,9):
    a = (X - b) // 200
    if  0 <= a < 1:
        print(cnt)
        break
    else:
        cnt -= 1
        b += 200
Buggy python submission (verdict: Runtime Error):
N = int(input())
cnt = 1000

while true:
  if cnt > N:
    print(N - cnt)
  else:
    cnt += 1000
break

Fixed submission:
N = int(input())
a = 1000 - N
while a < 0:
	a += 1000
print(a)
Buggy python submission (verdict: Runtime Error):
A. B = map(int,input().split())
print(A * B)

Fixed submission:
A, B = map(int,input().split())
print(A * B)
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()

a = len(S)


if a <= K:
    print(S)
else:
    print(S[:K] + ("..."))

Fixed submission:
s =str(input())
z = int(s[-1])
if z == 2 or z == 4 or z == 5 or z == 7 or z == 9:
	print("hon")
elif z == 0 or z == 1 or z == 6 or z == 8:
    print("pon")
else:
	print("bon")

Buggy python submission (verdict: Runtime Error):
s = str(input())
s[-1] = z
if z = 2 or 4 or 5 or 7 or 9;
	print("hon")
elif z = 0 or 1 or 6 or 8;
    print("pon")
else;
	print("bon")

Fixed submission:
s =str(input())
z = int(s[-1])
if z == 2 or z == 4 or z == 5 or z == 7 or z == 9:
	print("hon")
elif z == 0 or z == 1 or z == 6 or z == 8:
    print("pon")
else:
	print("bon")
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()

a = len(S)


if a =< K:
    print(S)
else:
    print(S[:K] + ("..."))
    

Fixed submission:
K = int(input())
S = input()

a = len(S)


if a <= K:
    print(S)
else:
    print(S[:K] + ("..."))
Buggy python submission (verdict: Runtime Error):
n = int(input)
print((n//2)+(n%2))

Fixed submission:
N = int(input())
A = N + 1

if N % 2 == 0:
  print(N // 2)
else:
  print(A // 2)
Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())
point = [list(map(int, input().split())) for x in range(N)]
count = 0
for i in range(n):
    if D >= (point[i][0]**2+point[i][1]**2)**0.5:
        count += 1
print(count)

Fixed submission:
N,D = map(int,input().split())
point = [list(map(int, input().split())) for x in range(N)]
count = 0
for i in range(N):
    if D >= (point[i][0]**2+point[i][1]**2)**0.5:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
int(X)
if X >= 30 :
  print("Yes")
else :
  print("No")

Fixed submission:
X = int(input())
if X >= 30 :
  print("Yes")
else :
  print("No")

Buggy python submission (verdict: Runtime Error):
X = input()
if X >=30:
  print("Yes")
else :
  print("No")

Fixed submission:
X = int(input())
if X >= 30 :
  print("Yes")
else :
  print("No")

Buggy python submission (verdict: Runtime Error):
x = int()
if x >= 30:
  print("yes")
  else
  print("no")
  

Fixed submission:
X = int(input())
if X >= 30 :
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())
a = 0
for num in N :
  X,Y = map(int,input().split())
  if X*X + Y*Y <= D*D :
    a = 1
print(a)

Fixed submission:
N,D = map(int,input().split())
a = 0
for num in range(1,N+1) :
  X,Y = map(int,input().split())
  if X*X + Y*Y <= D*D :
    a += 1
print(a)
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):
  exp = sum(p[i:i+K])
  if exp >= ans:
    ans = exp

    
print((ans+K)/2)

Fixed submission:
def cal(x): return (x+1)/2

N, K = map(int, input().split())
p = list(map(int, input().split()))

ans  = sum(cal(p[i]) for i in range(K))
    
cnt = ans

for i in range(K, N):
  cnt = cnt-cal(p[i-K])+cal(p[i])
  ans = max(cnt, ans)
print(ans)

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

ans = 0
ans_list = []
for i in range(N-K+1):
  exp = sum(p[i:i+K])
  if exp >= ans:
    ans = exp
    ans_list = p[i:i+K]
    
print((sum(ans_list)+K)/2)

Fixed submission:
def cal(x): return (x+1)/2

N, K = map(int, input().split())
p = list(map(int, input().split()))

ans  = sum(cal(p[i]) for i in range(K))
    
cnt = ans

for i in range(K, N):
  cnt = cnt-cal(p[i-K])+cal(p[i])
  ans = max(cnt, ans)
print(ans)

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

def expected_value(list):
  exp_list = []
  for i in range(len(list)):
    exp = (list[i]+1)/2
    exp_list.append(exp)
  return exp_list

ans = 0
ans_list = []
for i in range(N-K+1):
  exp = sum(p[i:i+K])
  if exp >= ans:
    ans = exp
    ans_list = p[i:i+K]
    
print(sum(expected_value(ans_list)))

Fixed submission:
def cal(x): return (x+1)/2

N, K = map(int, input().split())
p = list(map(int, input().split()))

ans  = sum(cal(p[i]) for i in range(K))
    
cnt = ans

for i in range(K, N):
  cnt = cnt-cal(p[i-K])+cal(p[i])
  ans = max(cnt, ans)
print(ans)

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

def expected_value(list):
  exp_list = []
  for i in range(len(list)):
    sum = list[i]*(list[i]+1)/2
    exp = sum/list[i]
    exp_list.append(exp)
  return exp_list

ans = 0
for i in range(N-K+1):
  exp_list = expected_value(p[i:i+K])
  exp = sum(exp_list)
  if exp >= ans:
    ans = exp
    
print(ans)

Fixed submission:
def cal(x): return (x+1)/2

N, K = map(int, input().split())
p = list(map(int, input().split()))

ans  = sum(cal(p[i]) for i in range(K))
    
cnt = ans

for i in range(K, N):
  cnt = cnt-cal(p[i-K])+cal(p[i])
  ans = max(cnt, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K =map(int, input().split())
H_list = list(map(int, input().split()))

print(H_list)

Fixed submission:
import math

H, A = map(int, input().split())

print(math.ceil(H/A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))

import numpy as np
P = np.array(P)

answer = 0
for i in range(N):
  if P[i]==min(P[:i+1]):
    answer += 1
    
print(answer)
    

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

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