Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
'''
.append(要素) リストに要素を追加 
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
import itertools
from functools import reduce
from operator import mul

f = [int(s) for s in stdin.readline().rstrip().split()]
N = f[0]
K = f[1]
p = list(map(lambda x: 1/2+x/2, [int(s)
                                 for s in stdin.readline().rstrip().split()]))

E = []
tmp = 0
for el in p:
    tmp += el
    E.append(tmp)

past = -20000
for el in range(len(E)):
    if el - K < 0:
        continue
    e = E[el] - E[el - K]
    if past < e:
        past = e
print(e)


Fixed submission:
'''
.append(要素) リストに要素を追加 
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
import itertools
from functools import reduce
from operator import mul


color = stdin.readline().rstrip().split()
nums = [int(s) for s in stdin.readline().rstrip().split()]
tar = stdin.readline().rstrip()
for el in range(2):
    if color[el] == tar:
        nums[el] -= 1
res = [str(s) for s in nums]
print(' '.join(res))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

N = int(stdin.readline().rstrip())
d = [int(s) for s in stdin.readline().rstrip().split()]
count = 0
sumF = d[0]
sumB = d[len(d) - 1]
count = 0
countF = 0
countB = len(d) - 1
while count != len(d):
    if sumF < sumB:
        sumF += d[countF+1]
        countF += 1
        count += 1
    elif sumB < sumF:
        sumB += d[countB-1]
        countB -= 1
        count += 1
    else:
        sumF += d[countF+1]
        countF += 1
        sumB += d[countB-1]
        countB -= 1
        count += 2
print(abs(sum(d[0:countF])-sum(d[countF:len(d)])))


Fixed submission:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

N = int(stdin.readline().rstrip())
d = [int(s) for s in stdin.readline().rstrip().split()]
count = 0
sumF = d[0]
sumB = d[len(d) - 1]
count = 0
countF = 0
countB = len(d) - 1
while count < len(d):
    if sumF < sumB:
        sumF += d[countF+1]
        countF += 1
        count += 1
    elif sumB < sumF:
        sumB += d[countB-1]
        countB -= 1
        count += 1
    else:
        sumF += d[countF+1]
        countF += 1
        sumB += d[countB-1]
        countB -= 1
        count += 2
print(abs(sum(d[0:countF])-sum(d[countF:len(d)])))
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()50
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''
num = int(stdin.readline().rstrip())
yaku = []
for el in range(1, num + 1):
    if (num % el == 0):
        yaku.append(el)
res = []
if (int(len(yaku)) % 2 == 0):
    res.append(yaku[int(len(yaku) / 2 - 1)])
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[1]-1))
else:
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[0]-1))


Fixed submission:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()50
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


num = int(stdin.readline().rstrip())
yaku = make_divisors(num)
yaku.sort()

res = []
if (int(len(yaku)) % 2 == 0):
    res.append(yaku[int(len(yaku) / 2 - 1)])
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[1]-1))
else:
    res.append(yaku[int((len(yaku)) / 2)])
    print(int(res[0]-1)+int(res[0]-1))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()50
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''
data = stdin.readline().rstrip().split()
a = float(data[0])
b = float(data[1])
x = float(data[2])
if (b * a * a >= 2 * x):
    print(90.0 - math.degrees(math.atan(2 * x / (a * b * b))))
else:
    print(90.0 - math.degrees(math.atan(a*a*a/(2 * a*a*b-2 * x))))


Fixed submission:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
del 配列名[場所]
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''
'''
sort()50
sorted(reverse=true)
'''
'''
2分探索
bisect.bisect_left(リスト, 要素)
'''
data = stdin.readline().rstrip().split()
a = float(data[0])
b = float(data[1])
x = float(data[2])
if (b * a * a >= 2 * x):
    print(90.0 - math.degrees(math.atan(2 * x / (a * b * b))))
elif (not a * a * b == x):
    print(90.0 - math.degrees(math.atan(a * a * a / (2 * a * a * b - 2 * x))))
else:
    print(0.0)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''

n = int(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)


Fixed submission:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''

tes = stdin.readline().rstrip().split()
a = int(tes[0])
b = int(tes[1])
res = a - b * 2
if (res <= 0):
    print(0)
else:
    print(res)
Buggy python submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)

Fixed submission:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''

n = int(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

ans = 0
for c in range(1,N):
    N_ = N-c
    sq_N_ = int(N_**(1/2))
    for a in range(1,sq_N_+1):
        if N_ % a == 0:
            b = N_//a
            ans += 2
        if a == b:
            ans -= 1
print(ans)

Fixed submission:
N = int(input())
 
ans = 0
for a in range(1,N):
    ans += (N-1)//a
        
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input_[0])

ans = 0
for c in range(1,N):
    N_ = N-c
    sq_N_ = int(N_**(1/2))
    for a in range(1,sq_N_+1):
        if N_ % a == 0:
            b = N_//a
            ans += 2
        if a == b:
            ans -= 1
print(ans)

Fixed submission:
N = int(input())
 
ans = 0
for a in range(1,N):
    ans += (N-1)//a
        
print(ans)

Buggy python submission (verdict: Runtime Error):
%%time
N = int(input())

ans = 0
for c in range(1,N):
    N_ = N-c
    sq_N_ = int(N_**(1/2))
    for a in range(1,sq_N_+1):
        if N_ % a == 0:
            b = N_//a
            ans += 2
        if a == b:
            ans -= 1
print(ans)

Fixed submission:
N = int(input())
 
ans = 0
for a in range(1,N):
    ans += (N-1)//a
        
print(ans)
Buggy python submission (verdict: Runtime Error):
X,K,D = list(map(int,input_[0].split()))

N = abs(X)//D

if N >= K:
    ans = abs(X) - K*D
elif (K-N)%2 == 0:
    ans = abs(X) - N*D
else:
    ans = D - (abs(X) - N*D)
print(ans)

Fixed submission:
X,K,D = list(map(int,input().split()))

N = abs(X)//D

if N >= K:
    ans = abs(X) - K*D
elif (K-N)%2 == 0:
    ans = abs(X) - N*D
else:
    ans = D - (abs(X) - N*D)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#C
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

P_before = 1
for k in range(K):
    P_before = P_before*A[k]
    
P_before


for i in range(K,N):
    P = P_before*A[i]//A[i-K]
    
    if P > P_before:
        print('Yes')
    else:
        print('No')
    
    P_before = P

Fixed submission:
#C
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

for i in range(K,N):
    
    if A[i] > A[i-K]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
ans=1
if 0 in A:
    ans=0
else:
    for a in A:
        ans=ans*a
        if ans > 10**18:
            ans=-1
            break

print(ans)

Fixed submission:
N=int(input())

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

ans=1
if 0 in A:
    ans=0
else:
    for a in A:
        ans=ans*a
        if ans > 10**18:
            ans=-1
            break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

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

ans=1
for a in A:
    ans=ans*a
    if ans > 10**18:
        ans=-1
        
if ans<0:
    ans=-1
        
print(ans)

Fixed submission:
N=int(input())

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

ans=1
if 0 in A:
    ans=0
else:
    for a in A:
        ans=ans*a
        if ans > 10**18:
            ans=-1
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
input_=Input.split('\n')
A,B=input_[0].split()
A=int(A)
B=int(B.replace('.', ''))
print(A,B)
print(int(A*B//100))

Fixed submission:
A,B=input().split()
A=int(A)
B=int(B.replace('.', ''))
print(int(A*B//100))

Buggy python submission (verdict: Runtime Error):
A,B=input().split()
A_=[A[:-2],A[-2:]]

if A_[0]=='':
    A_[0]='0'
    
A_[0]=int(A_[0])*100
A_[1]=int( A_[1])

A,B=input_[0].split()

B=float(B)
print(int(A_[0]*B + A_[1]*B))

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

if len(S) < K:
    print(S)
else:
    print(S[:K]+'...')

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

if len(S) <= K:
    print(S)
else:
    print(S[:K]+'...')

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

if len(S) < K:
    print(S)
else:
    print(S[:K]+'...')

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

if len(S) <= K:
    print(S)
else:
    print(S[:K]+'...')
Buggy python submission (verdict: Runtime Error):
import numpy as np
A,B,H,M=list(map(int,input().split()))

short_angle = 360*(1-(H+M/60)/12)
long_angle = 360*(1-M/60)

angle=abs(short_angle-long_angle)

if angle > 180:
    angle =360-angle
    
# print(angle)

ans_2=A**2+B**2-2*A*B*np.cos(np.pi*angle/180)
ans=np.sqrt(ans_2)

print(ans)

Fixed submission:
import numpy as np

A,B,H,M=list(map(int,input().split()))

short_angle = 360*(1-(H+M/60)/12)
long_angle = 360*(1-M/60)

angle=abs(short_angle-long_angle)

if angle > 180:
    angle =360-angle
    
# print(angle)

ans_2=A**2+B**2-2*A*B*np.cos(np.pi*angle/180)
ans=np.sqrt(ans_2)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd_2(a,b):
    if a<=b:
        x_min=a
        x_max=b
    else:
        x_min=b
        x_max=a
        
    while True:
#         print(x_min,x_max)
        if x_max % x_min ==0:
            return x_min
        
        x_temp = x_max % x_min
        
        x_max = x_min
        x_min = x_temp
        
def gcd(a,b,c):
    d=gcd_2(a,b)
    ans=gcd_2(d,c)
    return ans
  
N=int(input())
sum_gcd=0
for a_1 in range(1,N+1):
    for a_2 in range(1,N+1):
        for a_3 in range(1,N+1):
            sum_gcd+=gcd(a_1,a_2,a_3)
print(sum_gcd)

Fixed submission:
def gcd_2(a,b):
    if a<=b:
        x_min=a
        x_max=b
    else:
        x_min=b
        x_max=a
        
    while True:
#         print(x_min,x_max)
        if x_max % x_min ==0:
            return x_min
        
        x_temp = x_max % x_min
        
        x_max = x_min
        x_min = x_temp
        
def gcd(a,b,c):
    d=gcd_2(a,b)
    ans=gcd_2(d,c)
    return ans
  
N=int(input())
sum_gcd=0
for a_1 in range(1,N+1):
    for a_2 in range(1,N+1):
        for a_3 in range(1,N+1):
            sum_gcd+=gcd(a_1,a_2,a_3)
print(sum_gcd)

Buggy python submission (verdict: Runtime Error):
N=int(input())
sum_gcd=0
for a_1 in range(1,N+1):
    for a_2 in range(1,N+1):
        for a_3 in range(1,N+1):
            sum_gcd+=gcd(a_1,a_2,a_3)
print(sum_gcd)

Fixed submission:
def gcd_2(a,b):
    if a<=b:
        x_min=a
        x_max=b
    else:
        x_min=b
        x_max=a
        
    while True:
#         print(x_min,x_max)
        if x_max % x_min ==0:
            return x_min
        
        x_temp = x_max % x_min
        
        x_max = x_min
        x_min = x_temp
        
def gcd(a,b,c):
    d=gcd_2(a,b)
    ans=gcd_2(d,c)
    return ans
  
N=int(input())
sum_gcd=0
for a_1 in range(1,N+1):
    for a_2 in range(1,N+1):
        for a_3 in range(1,N+1):
            sum_gcd+=gcd(a_1,a_2,a_3)
print(sum_gcd)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input())

# N=4000
# S=[random.choice(['R','G','B']) for _ in range(N)]

S_dict={'R':set(),'G':set(),'B':set()}
for s_idx,s in enumerate(S):
    S_dict[s].add(s_idx+1)
    
# print(S_dict)
B_ = [0]*(2*N)
for s_b in S_dict['B']:
    B_[s_b]=1
    
S_R=S_dict['R']
S_G=S_dict['G']
    
ans=0
ans__=len(S_dict['B'])
for s_r in S_R:
    for s_g in S_G:
        ans_=ans__
        c_= abs(s_r-s_g)
        c_mean = 0
        if (s_r + s_g)%2 == 0:
            c_mean = (s_r + s_g)//2
            ans_ = get_ans(ans_,c_mean)
            
#         print('=====')
#         print(s_r,s_g,c_,c_mean)
        
        if s_r > s_g:
            ans_ = get_ans(ans_,s_r + c_)
            ans_ = get_ans(ans_,s_g - c_)
            
#             print(s_r + c_,s_g - c_)
            
        else:
            ans_=get_ans(ans_,s_r - c_)
            ans_=get_ans(ans_,s_g + c_)
            
#             print(s_r - c_,s_g + c_)
        
        ans+=ans_
        
#         print(ans_,ans)
        
print(ans)

Fixed submission:
N = int(input())
S = list(input())

def get_ans(ans_,c):
    if c < 0:
        pass
    else:
        ans_ -= B_[c]
    return ans_

# N=4000
# S=[random.choice(['R','G','B']) for _ in range(N)]

S_dict={'R':set(),'G':set(),'B':set()}
for s_idx,s in enumerate(S):
    S_dict[s].add(s_idx+1)
    
# print(S_dict)
B_ = [0]*(2*N)
for s_b in S_dict['B']:
    B_[s_b]=1
    
S_R=S_dict['R']
S_G=S_dict['G']
    
ans=0
ans__=len(S_dict['B'])
for s_r in S_R:
    for s_g in S_G:
        ans_=ans__
        c_= abs(s_r-s_g)
        c_mean = 0
        if (s_r + s_g)%2 == 0:
            c_mean = (s_r + s_g)//2
            ans_ = get_ans(ans_,c_mean)
            
#         print('=====')
#         print(s_r,s_g,c_,c_mean)
        
        if s_r > s_g:
            ans_ = get_ans(ans_,s_r + c_)
            ans_ = get_ans(ans_,s_g - c_)
            
#             print(s_r + c_,s_g - c_)
            
        else:
            ans_=get_ans(ans_,s_r - c_)
            ans_=get_ans(ans_,s_g + c_)
            
#             print(s_r - c_,s_g + c_)
        
        ans+=ans_
        
#         print(ans_,ans)
        
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B = list(map(int,input().split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

Fixed submission:
import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))

Buggy python submission (verdict: Runtime Error):
import math
A,B = list(map(int,input().split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

print(A_min,A_max,B_min,B_max)
if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

Fixed submission:
import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))

Buggy python submission (verdict: Runtime Error):
import math
A,B = list(map(int,input_[0].split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

print(A_min,A_max,B_min,B_max)
if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

Fixed submission:
import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))

Buggy python submission (verdict: Runtime Error):
import math
A,B = list(map(int,input().split()))

A_min=12*A+math.floor(0.5*A)
A_max=12*(A+1)+math.ceil(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)

print(A_min,A_max,B_min,B_max)
if A_max < B_min:
    print(-1)
elif B_max < A_min:
    print(-1)
else:
    print(max(A_,B_))

Fixed submission:
import math
A,B = list(map(int,input().split()))
 
A_min=12*A+math.ceil(0.5*A)
A_max=12*(A+1)+math.floor(0.5*(A+1))
B_min=10*B
B_max=10*(B+1)
 
if A_max <= B_min:
    print(-1)
elif B_max <= A_min:
    print(-1)
else:
    print(max(A_min,B_min))