Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
arr = []

for i in range(H):
  S = list(input())
  arr.append(S)
  
ck = 0
for i in range(H):
  for j in range(W):
    if arr[i][j] == "#":
      if i != 0:
        a = arr[i-1][j]
      else:
        a = "."
      if i != H-1:
        b = arr[i+1][j]
      else:
        b = "."
      if j != 0:
        c = arr[i][j-1]
      else:
        c = "."
      if j != W-1:
        d = arr[i][j+1]
      else:
        d = "."
    if a == "." and b == "." and c == "." and d == ".":
      ck = 1
      
if ck == 1:
  print("No")
else:
  print("Yes")

Fixed submission:
H,W = map(int,input().split())
arr = []

for i in range(H):
  S = list(input())
  arr.append(S)
  
ck = 0
for i in range(H):
  for j in range(W):
    if arr[i][j] == "#":
      if i != 0:
        a = arr[i-1][j]
      else:
        a = "."
      if i != H-1:
        b = arr[i+1][j]
      else:
        b = "."
      if j != 0:
        c = arr[i][j-1]
      else:
        c = "."
      if j != W-1:
        d = arr[i][j+1]
      else:
        d = "."

      if a == "." and b == "." and c == "." and d == ".":
        ck = 1
      
if ck == 1:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())
l = list(map(int,input().split()))

l.sort()

r = bisect.bisect_right(l, l[-1]/2)

a = l[r]
b = l[r+1]

a2 = min(a,l[-1]-a)
b2 = min(b,l[-1]-b)

if a2 >= b2:
  c = a
else:
  c = b

print( int( l[-1] ) ,int(c))


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

A.sort()

m = A[-1]
M = [abs((m / 2) - a) for a in A[: -1]]
r = A[M.index(min(M))]

print(m, r)

Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())
l = list(map(int,input().split()))

l.sort()

r = bisect.bisect_right(l, l[-1]/2)

a = l[r]
b = l[r+1]

a = min(a,l[-1]-a)
b = min(b,l[-1]-b)

print( int( l[-1] ) ,max(a,b))

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

A.sort()

m = A[-1]
M = [abs((m / 2) - a) for a in A[: -1]]
r = A[M.index(min(M))]

print(m, r)
Buggy python submission (verdict: Runtime Error):
import math

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(math.round(ans))


Fixed submission:
import math

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(round(ans))

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

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,5000000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(math.ceil(ans))


Fixed submission:
import math

N,M = map(int,input().split())

T = M * 1900 + (N-M) * 100

p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
  ans += T * p2 * i
  p2 = p2 * (1-p)
  
print(round(ans))
Buggy python submission (verdict: Runtime Error):
S = list(input())
T = list(input())

ck = 0
tl = len(T)
arr = []

for i in range(len(S)):
  a = S[i]
  if a == T[ck] or a == "?":
    ck += 1
  else:
    ck = 0
  if tl == ck:
    arr.append(i-tl+1)
  
if len(arr) == 0:
  print("UNRESTORABLE")
else:
  b = arr[-1]
  ans = ""
  for i in range(len(S)):
    if i == b:
      ans += ''.join(T)
    elif i > b and i <= b + tl:
      continue
    else:
      if S[i] == "?":
        ans += "a"
      else:
        ans += S[i]
  print(ans)

Fixed submission:
s=input()
t=input()
ans=[]
for i in range(len(s)-len(t)+1):
  start=i
  end=i+len(t)
  ok=True
  for j in range(len(t)):
    if s[start+j]!='?' and s[start+j]!=t[j]:
      ok=False
      break
  if ok:
    a=s[:start]+t+s[end:]
    ans.append(a.replace('?','a'))
if ans:
  ans=sorted(ans)
  print(ans[0])
else:
  print('UNRESTORABLE')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
t = list(map(int,input().split()))
v = list(map(int,input().split()))

time = 0
sum_t = sum(t)
velo_cap =[float("inf")]*(2*sum_t+1)
for i in range(N):
  start_t = time
  goal_t = time + 2*t[i]
  for s in range(0,2*sum_t+1):
    if s < start_t:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(start_t-s))
    elif s<goal_t:
      velo_cap[s] = min(velo_cap[s],2*v[i])
    else:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(s-goal_t))
  time += 2*t[i]
for s in range(2*sum_t+1):
  velo_cap[s] = min(velo_cap[s],2*sum_t-s,s)


print(sum(velo_cap)/4-(velo_cap[0]+velo_cap[-1])/8)


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

time = 0
sum_t = sum(t)
velo_cap =[float("inf")]*(2*sum_t+1)
for i in range(N):
  start_t = time
  goal_t = time + 2*t[i]
  for s in range(0,2*sum_t+1):
    if s < start_t:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(start_t-s))
    elif s<goal_t:
      velo_cap[s] = min(velo_cap[s],2*v[i])
    else:
      velo_cap[s] = min(velo_cap[s],2*v[i]+(s-goal_t))
  time += 2*t[i]
for s in range(2*sum_t+1):
  velo_cap[s] = min(velo_cap[s],2*sum_t-s,s)


print(sum(velo_cap)/4-(velo_cap[0]+velo_cap[-1])/8)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())

X = []
Y = []
Z = []

for i in range(N):
  x,y = map(int,input().split())
  X.append(x)
  Y.append(y)
  Z.append([x,y])
  
T = max(Y)
U = min(Y)
R = max(X)
L = min(X)
Y.sort()
X.sort()
ans = 10**100

for t in range(N):
  for u in range(N):
    for r in range(N):
      for l in range(N):
        T = Y[N-t-1]
        U = Y[u]
        R = X[N-r-1]
        L = X[l]
        cnt = 0
        for i in range(N):
          xi = Z[i][0]
          yi = Z[i][1]
          if xi >= L and xi <= R and yi >= U and yi <= T:
            cnt += 1
        if cnt >= K:
          M = int( (T-U) * (R-L) )
          ans = min(ans,M)
          
print(ans)

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

X = []
Y = []
Z = []

for i in range(N):
  x,y = map(int,input().split())
  X.append(x)
  Y.append(y)
  Z.append([x,y])
  
Y.sort()
X.sort()
ans = 10**100

for t in range(N):
  for u in range(N):
    for r in range(N):
      for l in range(N):
        T = Y[N-t-1]
        U = Y[u]
        R = X[N-r-1]
        L = X[l]
        
        if T <= U or R <= L:
          continue
        
        cnt = 0
        for i in range(N):
          xi = Z[i][0]
          yi = Z[i][1]
          if xi >= L and xi <= R and yi >= U and yi <= T:
            cnt += 1
        if cnt >= K:
          M = int( (T-U) * (R-L) )
          ans = min(ans,M)
          
print(ans)

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

X = []
Y = []
Z = []

for i in range(N):
  x,y = map(int,input().split())
  X.append(x)
  Y.append(y)
  Z.append([x,y])
  
T = max(Y)
U = min(Y)
R = max(X)
L = min(X)
Y.sort()
X.sort()
ans = 10**100

for t in range(N):
  for u in range(N):
    for r in range(N):
      for l in range(N):
        T = Y[N-t-1]
        U = Y[u]
        R = X[N-r-1]
        L = X[l]
        cnt = 0
        for i in range(N):
          xi = Z[i][0]
          yi = Z[i][1]
          if xi >= L and xi <= R and yi >= U and yi <= T:
            cnt += 1
        if cnt >= K:
          M = int( (T-U) * (R-L) )
          ans = min(ans,M)
          
print(ans)

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

X = []
Y = []
Z = []

for i in range(N):
  x,y = map(int,input().split())
  X.append(x)
  Y.append(y)
  Z.append([x,y])
  
Y.sort()
X.sort()
ans = 10**100

for t in range(N):
  for u in range(N):
    for r in range(N):
      for l in range(N):
        T = Y[N-t-1]
        U = Y[u]
        R = X[N-r-1]
        L = X[l]
        
        if T <= U or R <= L:
          continue
        
        cnt = 0
        for i in range(N):
          xi = Z[i][0]
          yi = Z[i][1]
          if xi >= L and xi <= R and yi >= U and yi <= T:
            cnt += 1
        if cnt >= K:
          M = int( (T-U) * (R-L) )
          ans = min(ans,M)
          
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

arr = [ int(input()) for i in range(N)]

arr.sort()
cnt = 0
num = 1

a = arr[0]

for i in range(1,N):
  if arr[i] == a:
    num += 1
  else:
    num = 1
    if num % 2 == 1:
      cnt += 1
printx(int(cnt))

Fixed submission:
N = int(input())

arr = [ int(input()) for i in range(N)]

arr.sort()
cnt = 0
num = 1

a = arr[0]

for i in range(1,N):
  if arr[i] == a:
    num += 1
  else:
    if num % 2 == 1:
      cnt += 1
    num = 1
    a = arr[i]
if num % 2 == 1:
  cnt += 1

print(int(cnt))
Buggy python submission (verdict: Runtime Error):
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra,floyd_warshall
N,M,R = map(int,input().split())

machi = list(map(int,input().split()))

List = [[10**6]*(N) for i in range(N)]
for i in range(M):
  a,b,c = map(int,input().split())
  
  if List[a-1][b-1] > c:
    List[a-1][b-1] = c
    List[b-1][a-1] = c
G = csgraph_from_dense(List, null_value=10**6)
d = floyd_warshall(G)

import itertools
a = list(itertools.permutations(machi))
arr = []
for i in a:
  ans = 0
  for j in range(R):
    if j != R-1 :
      ans += d[i[j]-1][i[j+1]-1]
  arr.append(ans) 
  
print(int(min(arr)))

Fixed submission:
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra,floyd_warshall
N,M,R = map(int,input().split())

machi = list(map(int,input().split()))

List = [[10**6]*(N) for i in range(N)]
for i in range(M):
  a,b,c = map(int,input().split())
  
  if List[a-1][b-1] > c:
    List[a-1][b-1] = c
    List[b-1][a-1] = c
G = csgraph_from_dense(List, null_value=10**6)
d = floyd_warshall(G)

import itertools
a = list(itertools.permutations(machi))
arr = []
for i in a:
  ans = 0
  for j in range(R):
    if j != R-1 :
      ans += d[i[j]-1][i[j+1]-1]
  arr.append(ans) 
  
print(int(min(arr)))
Buggy python submission (verdict: Runtime Error):
N = int(input())

arr = [int(input()) for i in range(N) ]

import math

from functools import reduce

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(arr))

Fixed submission:
N = int(input())

arr = [int(input()) for i in range(N) ]

import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)  
  
print(lcm_list(arr))
Buggy python submission (verdict: Runtime Error):
 int(input())
a = list(map(int, input().split()))
 
c = [0] * 9
 
for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1
 
c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]
 
print(c_min, c_max)
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)

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

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)

Buggy python submission (verdict: Runtime Error):
 int(input())
a = list(map(int, input().split()))
 
c = [0] * 9
 
for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1
 
c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]
 
print(c_min, c_max)
N = int(input())
a = list(map(int, input().split()))

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)
提出情報

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

c = [0] * 9

for rate in a:
    i = rate // 400
    if i < 8:
        c[i] = 1
    else:
        c[8] += 1

c_sum = sum(c[:8])
c_min = max(c_sum, 1)
c_max = c_sum + c[8]

print(c_min, c_max)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N,MA,MB = map(int,input().split())
arr = []

for i in range(N):
  l = list(map(int,input().split()))
  arr.append(l)
  
dp = [ [ [50000 for k in range(401)] for j in range(401)] for i in range(N+1) ]
dp[0][0][0] = 0

for i,a,b in itertools.product(range(1,N+1),range(401),range(401)):
  A = arr[i-1][0]
  B = arr[i-1][1]
  C = arr[i-1][2]
  
  if A <= a and B <= b:
    dp[i][a][b] = min(dp[i][a][b],dp[i-1][a-A][b-B] + C)
  else:
    dp[i][a][b] = dp[i-1][a][b]

ans = 50000
for i,a,b in itertools.product(range(N+1),range(401),range(401)):
  if a * MB == b ** MA and a != 0 and b != 0:
    ans = min(ans,dp[i][a][b])
if ans == 50000:
  print(-1)
else:
  print(int(ans))

Fixed submission:
import itertools

N,MA,MB = map(int,input().split())
arr = []

for i in range(N):
  l = list(map(int,input().split()))
  arr.append(l)
  
dp = [ [ [50000 for k in range(401)] for j in range(401)] for i in range(N+1) ]
dp[0][0][0] = 0
ans = 50000

for i,a,b in itertools.product(range(1,N+1),range(401),range(401)):
  A = arr[i-1][0]
  B = arr[i-1][1]
  C = arr[i-1][2]
  
  if A <= a and B <= b and dp[i-1][a-A][b-B] != 50000:
    dp[i][a][b] = min(dp[i-1][a][b],dp[i-1][a-A][b-B] + C)
  else:
    dp[i][a][b] = dp[i-1][a][b]

for a,b in itertools.product(range(401),range(401)):
    if a * MB == b * MA and a != 0 and b != 0:
      ans = min(ans,dp[-1][a][b])
    
if ans == 50000:
  print(-1)
else:
  print(int(ans))
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ans=0,cnt=0
for check in s:
    if t[cnt] == check:
        cnt+=1
    else:
        ans+=1
        cnt+=1
print(ans)

Fixed submission:
s = input()
t = input()
ans=0
cnt=0
for check in s:
    if t[cnt] == check:
        cnt+=1
    else:
        ans+=1
        cnt+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
#define STR 10
int main(){
    char a;
    scanf("%c",&a);
    if(isupper(a)==0){
        printf("a");
    }else{
        printf("A");
    }
    return 0;
}

Fixed submission:
c=input()
if c.isupper():
    print('A')
else:
    print('a')
Buggy python submission (verdict: Runtime Error):
r,d,x = map(int,input(),.split())

for i in range(10):
  x = r*x-d
  print(x)


Fixed submission:
r,d,x = map(int,input().split())

for i in range(10):
  x = r*x-d
  print(x)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
S = list(input())
if S[K] == "A":
  S[K] = "a"
  STR = "".join(S)
  print(STR)
elif S[K] == "B":
  S[K] = "b"
  STR = "".join(S)
  print(STR)
else:
  S[K] = "c"
  STR = "".join(S)
  print(STR)

Fixed submission:
N,K = map(int,input().split())
S = list(input())
if S[K-1] == "A":
  S[K-1] = "a"
  STR = "".join(S)
  print(STR)
elif S[K-1] == "B":
  S[K-1] = "b"
  STR = "".join(S)
  print(STR)
else:
  S[K-1] = "c"
  STR = "".join(S)
  print(STR)
Buggy python submission (verdict: Runtime Error):
s = str(input())
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Fixed submission:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy python submission (verdict: Runtime Error):
s = input()
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Fixed submission:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy python submission (verdict: Runtime Error):
s = list(str(1234))
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Fixed submission:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Buggy python submission (verdict: Runtime Error):
S = list(str())
pat1 = "YYMM"
pat2 = "MMYY"
pat3 = "AMBIGOUS"
pat4 = "NA"
mae =int(S[0] + S[1])
usiro = int(S[2] + S[3])
print(mae)
print(usiro)
if mae >= 13:
    if usiro >= 13:
        print(pat4)
    elif usiro != 0:
        print(pat1)
elif mae != 0:
    if usiro == 0:
        print(pat2)
    else:
        print(pat1)
else:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)

Fixed submission:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
    a,b,t = map(int,input().split())
    x = t // a
    y = x * b
    print(y)

Fixed submission:
a,b,t = map(int,input().split())
x = t // a
y = x * b
print(y)

Buggy python submission (verdict: Runtime Error):
a , b , t = map(int(), input().split())
x = 0
y = 0
x = t // a
y = x * b
print(y)

Fixed submission:
a,b,t = map(int,input().split())
x = t // a
y = x * b
print(y)

Buggy python submission (verdict: Runtime Error):
a,b,t = map(int(),input().split())
x = t // a
y = x * b
print(y)

Fixed submission:
a,b,t = map(int,input().split())
x = t // a
y = x * b
print(y)
Buggy python submission (verdict: Runtime Error):
import sys
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
  sys.exit()

if s[0://2] == s[n//2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
r = int(input() )
print(r*r)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
r = int(input() )
print(r*r)

Buggy python submission (verdict: Runtime Error):
r = input()
r1 = 1

print( r**2 )

Fixed submission:
r = int(input() )
print(r*r)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:s/2] == s[s/2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
	if s[0:n//2] == s[n//2:]:
  		print("Yes")
	else:
  		print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
	if s[0:n//2] == s[n//2:]:
  		print("Yes")
	else:
  		print("No")

Buggy python submission (verdict: Runtime Error):
a = [ input() for i in range(2)]
n = int(a[0])
s = a[0]
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
	if s[0:n//2] == s[n//2:]:
  		print("Yes")
	else:
  		print("No")

Buggy python submission (verdict: Runtime Error):
a = [ input() for i in range(n)]
n = int(a[0])
s = a[0]
if n % 2 == 1:
  print("No")

if s[0:n/2] == s[n/2:]:
  print("Yes")
else:
  print("No")


Fixed submission:
n = int(input())
s = input()
if n % 2 == 1:
  print("No")
else:
	if s[0:n//2] == s[n//2:]:
  		print("Yes")
	else:
  		print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
xy = [list(map(int, input().split(" "))) for i in range(N)]

L = 0
for i in range(len(xy)-1):
  a = xy[i][0]-xy[i+1][0]
  b = xy[i][1]-xy[i+1][2]
  l = np.sqrt( a**2 +b**2)
  L += l
print(L)


Fixed submission:
import numpy as np
N = int(input())
xy = [list(map(int, input().split(" "))) for i in range(N)]

L = 0
for i in range( N ):
 for j in range( N ):
  a = xy[i][0]-xy[j][0]
  b = xy[i][1]-xy[j][1]
  l = np.sqrt( a**2 +b**2)
  L += l

print(L/N)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
num_list = list(map(int, input().split()))

mod = 10**9 + 7
num_sum = 0

for i in range(N-1):
  for j in range(i+1, N):
    num_sum += num_list[i] * num_list[j]

print(num_sum % mod)



Fixed submission:
N = int(input())
num_list = list(map(int, input().split()))
mod = 10**9 + 7

sum_num = 0
sum_list = []
for num in num_list:
  sum_num += num
  sum_num = sum_num % mod
  sum_list.append(sum_num)

answer = 0
for i in range(N):
  sum_num -= num_list[i]
  sum_num = sum_num if sum_num >= 0 else sum_num + mod
  answer += num_list [i] * sum_num
  answer = answer % mod

print(answer)

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

mod = 10**9 + 7
num_sum = 0

for i in range(N-1):
  for j in range(i+1, N):
    num_sum += num_list[i] * num_list[j]

print(num_sum % mod)



Fixed submission:
N = int(input())
num_list = list(map(int, input().split()))
mod = 10**9 + 7

sum_num = 0
sum_list = []
for num in num_list:
  sum_num += num
  sum_num = sum_num % mod
  sum_list.append(sum_num)

answer = 0
for i in range(N):
  sum_num -= num_list[i]
  sum_num = sum_num if sum_num >= 0 else sum_num + mod
  answer += num_list [i] * sum_num
  answer = answer % mod

print(answer)
Buggy python submission (verdict: Runtime Error):
S = input()

answer = "Good"
prev_s = s[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s

print(answer)

Fixed submission:
S = input()
 
answer = "Good"
prev_s = S[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s
 
print(answer)

Buggy python submission (verdict: Runtime Error):
import math

A, B, C, D = map(int, input().split())
CD = int(C * D // math.gcd(C, D))

B_in_C = int(B/C)
B_in_D = int(B/D)
B_in_CD = int(B/(CD))
B_con = B - (B_in_C + B_in_D - B_in_CD)

A = A-1 if A > 1 else A
A_in_C = int(A/C)
A_in_D = int(A/D)
A_in_CD = int(A/(CD))
A_con = A - (A_in_C + A_in_D - A_in_CD)

print(B_con - A_con)

Fixed submission:
S = input()
 
answer = "Good"
prev_s = S[0]
for s in S[1:]:
  if prev_s == s:
    answer = "Bad"
    break
  prev_s = s
 
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, D = map(int, input().split())

count = 0
for i in range(A, B+1):
  if i % C != 0 and i % D != 0:
    count += 1

print(count)

Fixed submission:
import math
 
def lcm(a, b):
    return (a*b)//math.gcd(a, b)
 
a, b, c, d = map(int, input().split())
e = lcm(c, d)
 
total = b - (a - 1)
cc = b//c - (a-1)//c
dd = b//d - (a-1)//d
ee = b//e - (a-1)//e
 
ans = total - cc - dd + ee
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

def digit_sum(num):
  digit_sum = 0
  while(num > 0):
    digit_sum += num % 10
    num = int(num / 10)
  return digit_sum

min_num = 100000
for A in range(1, N):
  for B in range(1, N):
    if A + B != N:
      continue
    digit_num = digit_sum(A)
    digit_num += digit_sum(B)
    if digit_num < min_num:
      min_num = digit_num

print(min_num)

Fixed submission:
N = int(input())

def digit_sum(num):
  digit_sum = 0
  while(num > 0):
    digit_sum += num % 10
    num = int(num / 10)
  return digit_sum

min_num = 100000
for A in range(1, N):
  B = N - A
  digit_num = digit_sum(A)
  digit_num += digit_sum(B)
  if digit_num < min_num:
    min_num = digit_num

print(min_num)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

print(max([A + B, A - B, A * B]))


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

print(max([A + B, A - B, A * B]))

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

print(max(A + B, A - B, A * B))


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

print(max([A + B, A - B, A * B]))