Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
s = rr()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n):
    for j in range(i+1, n):
        k = j + j - i
        if k < n:
            if s[k] != s[j] and s[j] != s[i] and s[k] != s[i]:
                ans -= 1
print(ans)








Fixed submission:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))


n = ri()
s = rr()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n-2):
    for j in range(i+1, n-1):
        k = j + j - i
        if k < n:
            if s[k] != s[j] and s[j] != s[i] and s[k] != s[i]:
                ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline()
r = []
g = []
b = []
cnt = 0
i = 0
while i < n:
  if s[i] == "R":
    r.append(i)
  elif s[i] == "G":
    g.append(i)
  else:
    b.append(i)
for j in r:
  for k in g:
    for l in b:
      if l - k != k - j:
        cnt += 1
print(cnt)


Fixed submission:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))


n = ri()
s = rr()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n-2):
    for j in range(i+1, n-1):
        k = j + j - i
        if k < n:
            if s[k] != s[j] and s[j] != s[i] and s[k] != s[i]:
                ans -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline()
r = []
g = []
b = []
cnt = 0
i = 0
while i < n:
  if s[i] == "R":
    r.append(i)
  elif s[i] == "G":
    g.append(i)
  else:
    b.append(i)
for j in r:
  for k in g:
    for l in b:
      if l - k != k - j:
        cnt += 1
print(cnt)

Fixed submission:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))


n = ri()
s = rr()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n-2):
    for j in range(i+1, n-1):
        k = j + j - i
        if k < n:
            if s[k] != s[j] and s[j] != s[i] and s[k] != s[i]:
                ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split))
li.sort(reverse=False)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')

Fixed submission:
import sys
N, M = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li.sort(reverse=True)
if li[M-1] < sum(li)/(4*M):
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
import sys
S = sys.readline()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
S = sys.stdin.readline()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import sys
X = sys.stdin.readline()
score = X//500 * 1000
X %= 500
score += X//5 * 5
print(score)

Fixed submission:
import sys
X = sys.stdin.readline()
X = int(X)
score = (X//500) * 1000
X %= 500
score += (X//5) * 5
print(score)
Buggy python submission (verdict: Runtime Error):
import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = map(int, sys.stdin.readline().split())
scoreB = map(int, sys.stdin.readline().split())
scoreC = map(int, sys.stdin.readline().split())
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X-1]
scoreB = scoreB[:Y-1]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y-1]))


Fixed submission:
import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = list(map(int, sys.stdin.readline().split()))
scoreB = list(map(int, sys.stdin.readline().split()))
scoreC = list(map(int, sys.stdin.readline().split()))
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X]
scoreB = scoreB[:Y]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y]))

Buggy python submission (verdict: Runtime Error):
import sys
X, Y, A, B, C = sys.stdin.readline()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = map(int, sys.stdin.readline().split())
scoreB = map(int, sys.stdin.readline().split())
scoreC = map(int, sys.stdin.readline().split())
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X-1]
scoreB = scoreB[:Y-1]
scoreAll = scoreA + scoreB + scoreC
total = sum(scoreAll)


Fixed submission:
import sys
X, Y, A, B, C = sys.stdin.readline().split()
X = int(X)
Y = int(Y)
C = int(C)
scoreA = list(map(int, sys.stdin.readline().split()))
scoreB = list(map(int, sys.stdin.readline().split()))
scoreC = list(map(int, sys.stdin.readline().split()))
scoreA.sort(reverse=True)
scoreB.sort(reverse=True)
scoreC.sort(reverse=True)
scoreA = scoreA[:X]
scoreB = scoreB[:Y]
scoreAll = scoreA + scoreB + scoreC
scoreAll.sort(reverse=True)
print(sum(scoreAll[:X+Y]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
M = int(input())

print(N*(N-1)/2 + M*(M-1)/2)

Fixed submission:
import sys
N, M = map(int, sys.stdin.readline().split())

print(N*(N-1)//2 + M*(M-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections

ri = lambda: int(sys.stdin.readline())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
c = collections.Counter(a)
dp = [-1] * 2*10**5
for i in a:
    if dp[i-1] != -1:
        print(dp[i-1])
        continue
    ans = 0
    for k, v in c.items():
        ci = v
        if k == i:
            ci = max(0, v-1)
        ans += ci*(ci-1)//2
    dp[i-1] = ans
    print(ans)

Fixed submission:
import sys
import collections
ri = lambda: int(sys.stdin.readline())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
c = collections.Counter(a)
t = 0
for v in c.values():
    t += v*(v-1)//2

for i in a:
    print(t-c[i]+1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import collections
ri = lambda: int(sys.stdin.readline())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
c = collections.Counter(a)
for i in a:
    ans = 0
    for k, v in c.items():
        ci = v
        if k == i:
            ci = max(0, v-1)
        ans += ci*(ci-1)//2
    print(ans)

Fixed submission:
import sys
import collections
ri = lambda: int(sys.stdin.readline())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n = ri()
a = rl()
c = collections.Counter(a)
t = 0
for v in c.values():
    t += v*(v-1)//2

for i in a:
    print(t-c[i]+1)
Buggy python submission (verdict: Runtime Error):
import sys
n, a, b = map(int, sys.stdin.readline().split())
balls = n // (a+b) * a
if n % (a+b) <= a:
  balls += n % (a+b)
else:
  balls += a
print(balls)


Fixed submission:
s = input()
if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):

s =　input()
if s == 'AAA' or 'BBB':
  print('No')
else:
  print('Yes')


Fixed submission:
s = input()
if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
import sys
s = sys.stdin.readline()
if s = 'AAA' or 'BBB':
  print('No')
else:
  print('Yes')

Fixed submission:
s = input()
if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())

flag = False
s = rr()
q = ri()
for _ in range(q):
    query = list(rs())
    if query[0] == '1':
        flag = not flag
        continue
    else:
        f = int(query[1])
        c = query[-1]
        if flag == True:
            if f == 1:
                s += c
            else:
                s = c+s
        else:
            if f == 1:
                s = c+s
            else:
                s += c
if flag:
    print(s[::-1])
else:
    print(s)            

Fixed submission:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())

flag = False
s = rr()
q = ri()
front = ''
end = ''
for _ in range(q):
    query = list(rs())
    if query[0] == '1':
        flag = not flag
        continue
    else:
        f = int(query[1])
        c = query[-1]
        if flag == True:
            if f == 1:
                end += c
            else:
                front = c+front
        else:
            if f == 1:
                front = c+front
            else:
                end += c
if flag:
    print((front+s+end)[::-1])
else:
    print(front+s+end)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())

flag = False
s = rr()
q = ri()
for _ in range(q):
    query = list(rs())
    if query[0] == '1':
        flag = not flag
        continue
    else:
        f = int(query[1])
        c = query[-1]
        if flag == True:
            if f == 1:
                s += c
            else:
                s = c+s
        else:
            if f == 1:
                s = c+s
            else:
                s += c
if flag:
    print(s[::-1])
else:
    print(s)            
















Fixed submission:
import sys

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())

flag = False
s = rr()
q = ri()
front = ''
end = ''
for _ in range(q):
    query = list(rs())
    if query[0] == '1':
        flag = not flag
        continue
    else:
        f = int(query[1])
        c = query[-1]
        if flag == True:
            if f == 1:
                end += c
            else:
                front = c+front
        else:
            if f == 1:
                front = c+front
            else:
                end += c
if flag:
    print((front+s+end)[::-1])
else:
    print(front+s+end)
Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import heapq
import numpy as np

rl = sys.stdin.readline

n, m = map(int, rl().split())

a = [-1] * 3
isOk = False
for _ in range(m):
    b = list(map(int, rl().split()))
    if b[0]-1 != 2 and b[1] == 0: 
        isOk = True
        break
    if a[b[0]-1] != -1 and a[b[0]-1] != b[1]:
        isOk = True
        break
    a[b[0]-1] = b[1]

if isOk:
    print(-1)
else:
    ans = 0
    a.reverse()
    for i in range(3):
        if a[i] == -1:
            a[i] = 0
        ans += a[i]*(10**(i))
    print(ans)



Fixed submission:
import sys
N = int(sys.stdin.readline())
if N % 2 == 0:
  print(N//2)
else:
  print(N//2 + 1)
Buggy python submission (verdict: Runtime Error):
import sys
A1 = list(map(int, sys.stdin.readline().split()))
A2 = list(map(int, sys.stdin.readline().split()))
A3 = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
b = [int(sys.stdin.readline()) for _ in range(N)]
A = A1 + A2 + A3
i = 0
while i <= 8:
  if b.count(A[i]):
    A[i] = 101
  i += 1
bingoFlag = False
k = 0
while k <= 2:
  if A[k] == A[k+3] == A[k+6]:
    bingoFlag = True
    break
  k += 1
if A[0] == A[4] == A[8] or A[2] == A[4] == A[6]:
  bingoFlag = True
if bingFlag:
  print("Yes")
else:
  print("No")


Fixed submission:
import sys
A1 = list(map(int, sys.stdin.readline().split()))
A2 = list(map(int, sys.stdin.readline().split()))
A3 = list(map(int, sys.stdin.readline().split()))
N = int(sys.stdin.readline())
b = [int(sys.stdin.readline()) for _ in range(N)]
A = A1 + A2 + A3
i = 0
while i <= 8:
  if b.count(A[i]):
    A[i] = 101
  i += 1
bingoFlag = False
k = 0
while k <= 2:
  if A[k] == A[k+3] == A[k+6] or A[k*3] == A[k*3 + 1] == A[k*3 + 2]:
    bingoFlag = True
    break
  k += 1
if A[0] == A[4] == A[8] or A[2] == A[4] == A[6]:
  bingoFlag = True
if bingoFlag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
min = 0
for k in li:
    min += (k-i) ** 2
i = 2
while i <= 100:
  s = 0
  for k in li:
    s += (k-i) ** 2
  if s < min:
    min = s
  i += 1
print(min)
    

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
min = 0
for k in li:
    min += (k-1) ** 2
i = 2
while i <= 100:
  s = 0
  for k in li:
    s += (k-i) ** 2
  if s < min:
    min = s
  i += 1
print(min)
Buggy python submission (verdict: Runtime Error):
import sys
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = rl()
max_ = 0
for i in range(n-k+1):
  max_ = max(max_, sum(a[i:i+k]))
print((max_+k)/2)

Fixed submission:
import sys
s, t = map(str, sys.stdin.readline().split())
a, b = map(int, sys.stdin.readline().split())
u = sys.stdin.readline().rstrip()
if s == u:
  print(a-1, b)
else:
  print(a, b-1)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = (np.array(rl()) + 1)/2
ans = np.sum(a[:k])
for i in range(1, n-k+1):
    ans = max(ans, np.sum(a[i:i+k]))
print(ans)

Fixed submission:
import sys
from itertools import accumulate

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = [(i+1)/2 for i in rl()]
a = [0] + list(accumulate(a))
ans = 0
for i in range(n-k+1):
    ans = max(ans, a[i+k] - a[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = rl()
max_ = 0
for i in range(n-k+1):
  max_ = max(max_, sum(a[i:i+k]))
print((max_+k)/2)

Fixed submission:
import sys
from itertools import accumulate

rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
a = [(i+1)/2 for i in rl()]
a = [0] + list(accumulate(a))
ans = 0
for i in range(n-k+1):
    ans = max(ans, a[i+k] - a[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
l = len(li)
t = 0
if l > k:
  li.sort().reverse()
  t = sum(li[k:])
print(t)
  

Fixed submission:
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
l = len(li)
t = 0
if l > k:
  li.sort()
  li.reverse()
  t = sum(li[k:])
print(t)
Buggy python submission (verdict: Runtime Error):
import sys
n, m = map(int, sys.stdin.readline().split())
li = [[] for _ in range(m)]
for _ in range(m):
  i, k = map(str, sys.stdin.readline().split())
  i = int(i)
  li[i-1].append(k)
wa = 0
ac = 0
for i in li:
  for k in i:
    if k == 'WA':
      wa += 1
    if k == 'AC':
      ac += 1
      break
print(ac, wa)
  


Fixed submission:
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

n, k= map(int, rl().split())
li = [[0, 0] for _ in range(n)]
for _ in range(k):
    a, b = rl().split()
    b = b.rstrip()
    a = int(a) - 1
    if li[a][1] == 0:
        if b == 'WA':
            li[a][0] += 1
        else:
            li[a][1] = 1
ac = 0
wa = 0
for lis in li:
    i, v = lis
    if v == 1:
        ac += 1
        wa += i
print(ac, wa)
Buggy python submission (verdict: Runtime Error):
import sys
k, x = map(int, sys.stdin.readline())
if k*500 >= x:
  print('Yes')
else:
  print('No')

Fixed submission:
import sys
k, x = map(int, sys.stdin.readline().split())
if k*500 >= x:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
i = 0
cnt = 0
while i <= n -3:
  if s[i:i+3] == 'ABC':
    cnt += 1
print(cnt)

Fixed submission:
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
i = 0
cnt = 0
while i <= n -3:
  if s[i:i+3] == 'ABC':
    cnt += 1
  i += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

r = map(int, rl().split())
n1 = int(rl().strip())
n2 = int(rl().strip())
li = itertools.combinations(n1, r)
print(abs(li.index(n1) - li.index(n2)))

Fixed submission:
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline

r = int(rl())
n1 = tuple(map(int, rl().split()))
n2 = tuple(map(int, rl().split()))
li = list(itertools.permutations(range(1, r+1)))
print(abs(li.index(n1) - li.index(n2)))
Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools

rl = sys.stdin.readline
x = int(rl())
while True:
    if x % 2:
      for i in range(3, 7//2, 2):
        if x % i == 0
        break
      else:
        print(x)
        break
    x += 1



Fixed submission:
import sys
import math
import itertools

rl = sys.stdin.readline
x = int(rl())
while True:
    if x == 2:
        print(2)
        break
    if x % 2:
      for i in range(3, x//2, 2):
        if x % i == 0:
            break
      else:
        print(x)
        break
    x += 1

Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools
import numpy
import sympy

rl = sys.stdin.readline
x = int(rl())
while True:
    if sympy.isprime(x):
        print(x)
        break
    x += 1



Fixed submission:
import sys
import math
import itertools

rl = sys.stdin.readline
x = int(rl())
while True:
    if x == 2:
        print(2)
        break
    if x % 2:
      for i in range(3, x//2, 2):
        if x % i == 0:
            break
      else:
        print(x)
        break
    x += 1
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
s, t = map(str, sys.stdin.readline())
text = ''
for i in s:
  for k in t:
    text += i
    text += k
print(text)

Fixed submission:
import sys
n = int(sys.stdin.readline())
s, t = map(str, sys.stdin.readline().split())
i = 0
text = ''
while i < n:
  text += s[i] + t[i]
  i += 1
print(text)
Buggy python submission (verdict: Runtime Error):
import sys
import fractions
a, b = map(int, sys.stdin.raedline())
gcd = fractions.gcd(a, b)
print(a * b // gcd)

Fixed submission:
import sys
import fractions
a, b = map(int, sys.stdin.readline().split())
gcd = fractions.gcd(a, b)
print(a * b // gcd)
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
if not n % 2:
  if s[0:n/2] == s[n/2:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Fixed submission:
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
if not n % 2:
  if s[0:n//2] == s[n//2:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
  lis = list(map(int, rl().split()))
  li.append(lis)
t = 0
for i in list(collections.permutations(n)):
  for k in range(n-1):
    s = (li[i[k]][0] - li[i[k+1]][0])**2 + (li[i[k]][1] - li[i[k+1]][1])**2
    t += s**0.5
print(t/math.factorial(n))
  
  
  


Fixed submission:
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
  lis = list(map(int, rl().split()))
  li.append(lis)
t = 0
for i in list(itertools.permutations(range(n))):
  for k in range(n-1):
    s = (li[i[k]][0] - li[i[k+1]][0])**2 + (li[i[k]][1] - li[i[k+1]][1])**2
    t += s**0.5
print(t/math.factorial(n))

Buggy python submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
  lis = list(map(int, rl().split()))
  li.append(lis)
t = 0
for i in collections.permutations(n):
  for k in range(n-1):
    s = (li[i[k]][0] - li[i[k+1]][0])**2 + (li[i[k]][1] - li[i[k+1]][1])**2
    t += s**0.5
print(t/math.factorial(n))
  
  
  

Fixed submission:
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline
n = int(rl())
li = []
for _ in range(n):
  lis = list(map(int, rl().split()))
  li.append(lis)
t = 0
for i in list(itertools.permutations(range(n))):
  for k in range(n-1):
    s = (li[i[k]][0] - li[i[k+1]][0])**2 + (li[i[k]][1] - li[i[k+1]][1])**2
    t += s**0.5
print(t/math.factorial(n))
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.radline())
li = list(map(int, sys.stdin.readline().split()))
s = 0
i = 0
while i < n-1:
  s += li[i] * li[i+1]
  i += 1
print(s)

Fixed submission:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
s = 0
i = 0
while i < n-1:
  k = i+1
  while k < n:
    s += li[i] * li[k]
    k += 1
  i += 1
print(s)
Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
cnt = 0
for i in li:
  if i >= k:
    cnt += 1
print(cnt)


Fixed submission:
import sys, math
a = int(sys.stdin.readline().rstrip())
b = math.ceil(a / 2)
print(b / a)
Buggy python submission (verdict: Runtime Error):
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.readline().split()))
cnt = 0
for i in li:
  if i >= k:
    cnt += 1
print(cnt)

Fixed submission:
import sys
n, k = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
cnt = 0
for i in li:
  if i >= k:
    cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(sys.stdin.readline())
lia = list(map(int, sys.stdin.readline().split()))
lib = list(map(int, sys.stdin.readline().split()))
lic = list(map(int, sys.stdin.readline().split()))
s = sum(lib)
li = []
i = 0
while i < n-1:
  if lia[i+1] - lia[i] == 1:
    li.append(i)
for i in li:
  s += lic[i]
print(s)

Fixed submission:
import sys
n = int(sys.stdin.readline())
lia = list(map(int, sys.stdin.readline().split()))
lib = list(map(int, sys.stdin.readline().split()))
lic = list(map(int, sys.stdin.readline().split()))
s = sum(lib)
li = []
i = 0
while i < n-1:
  if lia[i+1] - lia[i] == 1:
    li.append(lia[i]-1)
  i += 1
for i in li:
  s += lic[i]
print(s)
Buggy python submission (verdict: Runtime Error):
import sys
a = sys.stdin.readline().rstrip()
b = sys.stdin.readline().rstrip()
i = 0
cnt = 0
while i <= 3:
  cnt += 1 if a[i] == b[i] else 0
  i += 1
print(cnt)

Fixed submission:
import sys
a = sys.stdin.readline().rstrip()
b = sys.stdin.readline().rstrip()
i = 0
cnt = 0
while i <= 2:
  cnt += 1 if a[i] == b[i] else 0
  i += 1
print(cnt)