Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()

count_list = []
for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        count_list.append(True)
    else:
        count_list.append(False)

l = len(S)
freq_list = []
for i in range(l):
    count = 0
    for j in range(l-i):
        if count_list[i+j] is True:
            count += 1
        else:
            freq_list.append(count)
            break

print(max(freq_list))




Fixed submission:
S = input()

count_list = []
for i in S:
    if i == 'A' or i == 'C' or i == 'G' or i == 'T':
        count_list.append(True)
    else:
        count_list.append(False)

l = len(S)
freq_list = []
for i in range(l):
    count = 0
    for j in range(l-i):
        if count_list[i+j] is True:
            count += 1
            freq_list.append(count)
        else:
            freq_list.append(count)
            break

print(max(freq_list))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

count = 0

while len(S) >= 2 and S != '1' * len(S) and S != '0' * len(S):
    #前から２つ組にして抜いて判定する
    new_S = ''
    for i in range(len(S)//2):
        if S[2*i:(2*i)+2] == '10' or S[2*i:(2*i)+2] == '01':
            count += 1
        else:
            new_S += S[2*i:(2*i)+2]
    #len(S)が奇数の時は最後が抜ける
    if len(S) % 2 == 1:
        new_S += S[-1]
    else:
        pass
    S = new_S

    if len(S) < 2 or S == '1' * len(S) or S == '0' * len(S):
        print(count * 2)
        break
    else:
        #頭一つずらして２つ組にして判定する
        new_S = S[0]
        for i in range((len(S)-1)//2):
            if S[2*i+1:(2*i)+3] == '10' or S[2*i+1:(2*i)+3] == '01':
                count += 1
            else:
                new_S += S[2*i+1:(2*i)+3]
        #len(S)が偶数の時は最後が抜けるから足してやる
        if len(S) % 2 == 0:
            new_S += S[-1]
        else:
            pass
        S = new_S
else:
    print(count * 2)



Fixed submission:
S = input()

zero_count = S.count('0')
one_count =S.count('1')

count = min(zero_count, one_count)

print(count * 2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for n in range(1, N + 1)[::-1]:
    if n * n <= N:
        print(str(n * n))
        break
    else:
        pass


Fixed submission:
import numpy as np
N = int(input())

ans = int(np.sqrt(N))
print(ans ** 2)
Buggy python submission (verdict: Runtime Error):
S = input()

S_list = []
for s in S:
    if s not in S_list:
        S_list.append(s)

S_list.sort()

al_list = [chr(i) for i in range(97, 97+26)]

check_list = []
for i in range(26):
    if S_list[i] != al_list[i]:
        print(al_list[i])
        break
    else:
        check_list.append(True)

if len(check_list) == 26:
    print('None')


Fixed submission:
S = input()

S_list = []
for s in S:
    if s not in S_list:
        S_list.append(s)

S_list.sort()

al_list = [chr(i) for i in range(97, 97+26)]

check_list = []
for i in range(len(S_list)):
    if S_list[i] == al_list[i]:
        check_list.append(True)
    else:
        check_list.append(False)

count = 0
for c in check_list:
    if c is True:
        count += 1
    else:
        count += 0

if count == 26:
    print('None')
else:
    print(al_list[count])
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

count = 0
count_list = []
for i in S:
    if i == 'I':
        count += 1
        count_list.append(count)
    elif i == 'D':
        count -= 1
    else:
        print('Error')
    
max_count = max(count_list)
if max_count > 0:
    print(max_count)
else:
    print(0)


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

count = 0
count_list = [0]
for i in S:
    if i == 'I':
        count += 1
        count_list.append(count)
    elif i == 'D':
        count -= 1
    else:
        print('Error')
    
print(max(count_list))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
b = list(int(x) for x in input().split())
a=np.array(b)

x = 0
for i in range(n):
    if (a[0] in np.delete(a, 0)) is True:
        print("NO")
        x = 1
        break

if x == 0:
    print("YES")


Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Buggy python submission (verdict: Runtime Error):
s,t=map(input().split())
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Buggy python submission (verdict: Runtime Error):
s,t=map(input().split())
a,b=map(int,input().split())
c=input()
d=""
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Buggy python submission (verdict: Runtime Error):
s,t=map(input().split())
a,b=map(int,input().split())
c=input()
 
if s==c:
  print("{}""{}".format(a-1,b))
else:
  print("{}""{}".format(a,b-1))

Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))

Buggy python submission (verdict: Runtime Error):
s,t=map(input().split())
a,b=map(int,input().split())
c=int()

if s==c:
  print("{}""{}".format(a-1,b))
else:
  print("{}""{}".format(a,b-1))

Fixed submission:
s,t=input().split()
a,b=map(int,input().split())
c=input()
d=" "
if s==c:
  print("{}""{}""{}".format(a-1,d,b))
else:
  print("{}""{}""{}".format(a,d,b-1))
Buggy python submission (verdict: Runtime Error):
4
BRBR

Fixed submission:
N = int(input())
print("Yes" if input().count("R") > N//2 else "No")
Buggy python submission (verdict: Runtime Error):
from math import gcd

N, X = map(int, input().split())
x = [abs(X-int(x)) for x in input().split()]
if N==1:
    print(x[0])
else:
    GCD = gcd(x[0],x[1])
    for i in range(2,N):
        GCD = gcd(GCD,x[i])
    print(GCD)
    

Fixed submission:
# from math import gcd
def gcd(x, y):
    if y > x:
        x, y = y, x
    if y == 0:
        return x
    return gcd(y, x % y)


N, X = map(int, input().split())
x = [abs(X-int(x)) for x in input().split()]
if N == 1:
    print(x[0])
else:
    GCD = gcd(x[0], x[1])
    for i in range(2, N):
        GCD = gcd(GCD, x[i])
    print(GCD)
Buggy python submission (verdict: Runtime Error):
N,K =map(int,input().split())
arr = [int(x) for x in input().split()]
ps = []
ms = []
for i in range(N):
    if arr[i] == 0:
        K -= 1
    elif arr[i] < 0:
        ms.append(abs(arr[i]))
    elif arr[i] > 0:
        ps.append(arr[i])
ms = ms[::-1]
if K <= 0:
    ans = 0
else:
    ans = ps[K-1] if K <= len(ps) else 10**18
    ans = min(ans,ms[K-1]) if K <= len(ms) else ans
if len(ps) > 0 and len(ms) > 0:
    for i in range(K):
        if i == len(ms):
            break
        ans = min(ans,ms[i]*2 + ps[K-(i+1)-1])
    for i in range(K):
        if i == len(ps):
            break
        ans = min(ans,ps[i]*2 + ms[K-(i+1)-1])
print(ans)
    

Fixed submission:
N, K = map(int, input().split())
arr = [int(x) for x in input().split()]
ps = []
ms = []
for i in range(N):
    if arr[i] == 0:
        K -= 1
    elif arr[i] < 0:
        ms.append(abs(arr[i]))
    elif arr[i] > 0:
        ps.append(arr[i])
ms = ms[::-1]
if K <= 0:
    ans = 0
else:
    ans = ps[K-1] if K <= len(ps) else 10**18
    ans = min(ans, ms[K-1]) if K <= len(ms) else ans
if len(ps) > 0 and len(ms) > 0:
    for i in range(len(ms)):
        if K-(i+1)-1 < len(ps):
            ans = min(ans, ms[i]*2 + ps[K-(i+1)-1])
    for i in range(len(ps)):
        if K-(i+1)-1 < len(ms):
            ans = min(ans, ps[i]*2 + ms[K-(i+1)-1])
print(ans)

Buggy python submission (verdict: Runtime Error):
from itertools import accumulate
N,K =map(int,input().split())
arr = [int(x) for x in input().split()]
ps = []
ms = []
for i in range(N):
    if arr[i] == 0:
        K -= 1
    elif arr[i] < 0:
        ms.append(abs(arr[i]))
    elif arr[i] > 0:
        ps.append(arr[i])
ms = ms[::-1]
if K == 0:
    ans = 0
else:
    ans = ps[K-1] if K <= len(ps) else 10**18
    ans = min(ans,ms[K-1]) if K <= len(ms) else ans
if len(ps) > 0 and len(ms) > 0:
    for i in range(K):
        if i == len(ms):
            break
        ans = min(ans,ms[i]*2 + ps[K-(i+1)-1])
    for i in range(K):
        if i == len(ps):
            break
        ans = min(ans,ps[i]*2 + ms[K-(i+1)-1])
print(ans)
    

Fixed submission:
N, K = map(int, input().split())
arr = [int(x) for x in input().split()]
ps = []
ms = []
for i in range(N):
    if arr[i] == 0:
        K -= 1
    elif arr[i] < 0:
        ms.append(abs(arr[i]))
    elif arr[i] > 0:
        ps.append(arr[i])
ms = ms[::-1]
if K <= 0:
    ans = 0
else:
    ans = ps[K-1] if K <= len(ps) else 10**18
    ans = min(ans, ms[K-1]) if K <= len(ms) else ans
if len(ps) > 0 and len(ms) > 0:
    for i in range(len(ms)):
        if K-(i+1)-1 < len(ps):
            ans = min(ans, ms[i]*2 + ps[K-(i+1)-1])
    for i in range(len(ps)):
        if K-(i+1)-1 < len(ms):
            ans = min(ans, ps[i]*2 + ms[K-(i+1)-1])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
        a %= mod
        b %= mod
        c %= mod
    elif C == "A":
        a += p
        a %= mod
    elif C == "B":
        b += a
        b %= mod
    elif C == "C":
        c += b
        c %= mod
print(c)

Fixed submission:
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    elif C == "A":
        a += p
    elif C == "B":
        b += a
    elif C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
    p %= mod
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    elif C == "A":
        a += p
    elif C == "B":
        b += a
    elif C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
print(c)

Fixed submission:
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    elif C == "A":
        a += p
    elif C == "B":
        b += a
    elif C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
    p %= mod
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    if C == "A":
        a += p
    if C == "B":
        b += a
    if C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
print(c)


Fixed submission:
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    elif C == "A":
        a += p
    elif C == "B":
        b += a
    elif C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
    p %= mod
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    if C == "A":
        a += p
    if C == "B":
        b += a
    if C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
print(c)


Fixed submission:
S = input()
a = 0
b = 0
c = 0
p = 1
mod = 1000000000+7
for C in S:
    if C == "?":
        c = 3*c+b
        b = 3*b+a
        a = 3*a+p
        p *= 3
    elif C == "A":
        a += p
    elif C == "B":
        b += a
    elif C == "C":
        c += b
    a %= mod
    b %= mod
    c %= mod
    p %= mod
print(c)
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate

N = int(input())
count = [0 for i in range(N+1)]
count[0] += 1
for i in accumulate([int(x) for x in input().split()]):
    count[i] += 1
ans = 0
for i in count:
    ans += (i*(i-1)) // 2
print(ans)


Fixed submission:
from itertools import accumulate

N = int(input())
count = {}
count.setdefault(0, 1)
for i in accumulate([int(x) for x in input().split()]):
    count.setdefault(i, 0)
    count[i] += 1
ans = 0
for i in count.values():
    ans += (i*(i-1)) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
def solv(S):
    c = []
    for i in range(25, 0, -1):
        for j in range(i-1, -1, -1):
            if S[i] > S[j]:
                c.append(S[:j]+S[i])
    print(sorted(c)[0])
    return


alph = "abcdefghijklmnopqrstuvwxyz"
S = input()
for c in S:
    alph = alph.replace(c, "")
if alph != "":
    print(S+alph[0])
else:
    if S == alph[::-1]:
        print(-1)
    else:
        solv(S)


Fixed submission:
def solv(S):
    c = []
    for i in range(25, 0, -1):
        for j in range(i-1, -1, -1):
            if S[i] > S[j]:
                c.append(S[:j]+S[i])
    print(sorted(c)[0])
    return


alph = "abcdefghijklmnopqrstuvwxyz"
S = input()
for c in S:
    alph = alph.replace(c, "")
if alph != "":
    print(S+alph[0])
else:
    alph = "abcdefghijklmnopqrstuvwxyz"
    if S == alph[::-1]:
        print(-1)
    else:
        solv(S)
Buggy python submission (verdict: Runtime Error):
2
ip cc

Fixed submission:
n = int(input())
s,t = map(str, input().split())
moji = ""

for i in range(n):
  moji += s[i] + t[i]

print(moji)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
five = 0

if n%2 ==0:
  for i in range(n//2):
    s = n-2*i
    while (1):
      if s%5 == 0:
        s = s//5
        five += 1
      else:
        break
  print(five)
else:
  print(0)


Fixed submission:
n = int(input())
fives = n
cnt = 0
cnt2 = 0

if n%2 == 0:
  while (1):
    if fives // 5 > 0:
      fives //= 5
      cnt += 1
    else:
      break

for i in range(cnt):
  cnt2 += n // (2*5**(i+1))

print(cnt2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = 1
cnt = 0

for i in range(n//2):
  a *= (n-2*i)

while (1):
  if a % 10 == 0:
    cnt += 1
    a = a//10
  else:
    break
print(cnt)

Fixed submission:
n = int(input())
fives = n
cnt = 0
cnt2 = 0

if n%2 == 0:
  while (1):
    if fives // 5 > 0:
      fives //= 5
      cnt += 1
    else:
      break

for i in range(cnt):
  cnt2 += n // (2*5**(i+1))

print(cnt2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
xy = [[]] * n
cnt = 0

for i in range(n):
    xy[i] = [list(map(int, input().split())) for j in range(int(input()))]

bit = '0' + str(n) + 'b'
for k in range(2**n):
  cnt_current = 0
  flg = True
  katei = format(k, bit)
  
  for l in range(len(xy)):
    if katei[l] == '0':
      continue
    else:
      for m in range(len(xy[l])):
        if int(xy[l][m][1]) != int(katei[xy[l][m][0]-1]):
          flg = False
  if flg == True:
    cnt_current = katei.count('1')
  if cnt_current > cnt:
    cnt = cnt_current
    
print(cnt)

Fixed submission:
n = int(input())
xy = [[]] * n
cnt = 0

for i in range(n):
    xy[i] = [list(map(int, input().split())) for j in range(int(input()))]

bit = '0' + str(n) + 'b'
for k in range(2**n):
  cnt_current = 0
  flg = True
  katei = format(k, bit)
  
  for l in range(len(xy)):
    if flg == False:
      break
    if katei[l] == '0':
      continue
    else:
      for m in range(len(xy[l])):
        if int(xy[l][m][1]) != int(katei[xy[l][m][0]-1]):
          flg = False
          break
  if flg == True:
    cnt_current = katei.count('1')
  if cnt_current > cnt:
    cnt = cnt_current
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
A, B, X = map(int, input().split())


def is_ok(N):
    return A * N + B * len(str(N)) <= X


ok = 0
ng = 10 ** 9 + 1
while ng - ok > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m
print(ok)


Fixed submission:
s = str(input())
if s == 'SUN':
  print(7)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
Buggy python submission (verdict: Runtime Error):
#a,b,c = map(int, input().split())

if (a >= b) and (a >= c):
    print(b*c/2)
if (b >= a) and (b >= c):
    print(a*c/2)
if (c >= a) and (c >= b):
    print(a*b/2)

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

if (a >= b) and (a >= c):
    print(int(b*c/2))
if (b >= a) and (b >= c):
    print(int(a*c/2))
if (c >= a) and (c >= b):
    print(int(a*b/2))
Buggy python submission (verdict: Runtime Error):
s = 123456789
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s % sum = 0:
  print("yes")
else:
  print("no")


Fixed submission:
s = raw_input()
print (s.count("+") - s.count("-"))

Buggy python submission (verdict: Runtime Error):
s = input()
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

print(sum)

Fixed submission:
s = raw_input()
print (s.count("+") - s.count("-"))

Buggy python submission (verdict: Runtime Error):
s = input()
print (s.count("+") - s.count("-"))


Fixed submission:
s = raw_input()
print (s.count("+") - s.count("-"))

Buggy python submission (verdict: Runtime Error):
s = raw_input()
print (s.count("+") - s.count("-"))


Fixed submission:
s = raw_input()
print (s.count("+") - s.count("-"))

Buggy python submission (verdict: Runtime Error):
s = raw_input()
print(s.count("+") - s.count("-"))

Fixed submission:
s = raw_input()
print (s.count("+") - s.count("-"))
Buggy python submission (verdict: Runtime Error):
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s_hold % sum == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s_hold % sum == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = raw_input()
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s_hold % sum == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s_hold % sum == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s % sum == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s % sum = 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = 123456789
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if s % sum = 0:
  print("Yes")
else:
  print("No")


Fixed submission:
s = int(input())
s_hold = s
sum = 0
i = 0

while i < 9:
  sum = sum + s % 10
  s = s // 10
  i = i + 1

if sum == 0:
  print("Yes")
elif s_hold % sum == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
S, T = input().split(' ')
A, B = list(map(int, input().split(' ')))
U = input()
if U==S: return A-1,B
if U==T: return A,B-1

Fixed submission:
S, T = input().split(' ')
A, B = list(map(int, input().split(' ')))
U = input()
if U==S: print(A-1,B)
if U==T: print(A,B-1)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = max([sum(pi[i:K+i]) for i in range(N-K+1)])
print((value+K)/2)

Fixed submission:
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = sum(pi[:K])
max_value = value
for i in range(N-K):
  value -= pi[i]
  value += pi[i+K]
  max_value = max(value, max_value)
print((max_value+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = max(sum([(n+1)/2 for n in pi[i:K+i]]) for i in range(N-K+1))
print(value)

Fixed submission:
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = sum(pi[:K])
max_value = value
for i in range(N-K):
  value -= pi[i]
  value += pi[i+K]
  max_value = max(value, max_value)
print((max_value+K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
candidate = [sum([(n+1)/2 for n in pi[i:K+i]]) for i in range(N-K+1)]
value = max(candidate)
print(value)

Fixed submission:
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = sum(pi[:K])
max_value = value
for i in range(N-K):
  value -= pi[i]
  value += pi[i+K]
  max_value = max(value, max_value)
print((max_value+K)/2)

Buggy python submission (verdict: Runtime Error):
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = pi[:K]
max_value = value
for i in range(K, N):
  value -= pi[i-K]
  value += pi[K]
  if value>max_value:
    max_value = value
print(max_value/float(K))

Fixed submission:
N,K = list(map(int,input().split(' ')))
pi = list(map(int,input().split(' ')))
value = sum(pi[:K])
max_value = value
for i in range(N-K):
  value -= pi[i]
  value += pi[i+K]
  max_value = max(value, max_value)
print((max_value+K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted(map(int,input().split()))
B = sorted(map(int,input().split()))
C = sorted(map(int,input().split()))

def f(X,Y,S):
	i,ret = 0, [0 for _ in range(N)]
	for k,x in enumerate(X):
		while x>=Y[i]:
			i += 1
			if i==N: return ret
		if S is None:	ret[k] = N-i
		else:			ret[k] = sum(S[i:])
	return ret

K = f(B,C,None)
K = f(A,B,K)
print(sum(K))


Fixed submission:
import bisect
N = int(input())
A = sorted(map(int,input().split()))
B = sorted(map(int,input().split()))
C = sorted(map(int,input().split()))
print(sum(bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) for b in B))

Buggy python submission (verdict: Time Limit Exceeded):
N  = int(input())
Ai = sorted(map(int,input().split()))
Bi = sorted(map(int,input().split()))
Ci = sorted(map(int,input().split()))

def f(X,Y,S):
	i,ret = 0, [0 for _ in range(N)]
	for k,x in enumerate(X):
		while x>=Y[i]:
			i += 1
			if i==N: return ret
		ret[k] = sum(S[i:])
	return ret

Ki = f(Bi,Ci,[1]*N)
Hi = f(Ai,Bi,Ki)
print(sum(Hi))




Fixed submission:
import bisect
N = int(input())
A = sorted(map(int,input().split()))
B = sorted(map(int,input().split()))
C = sorted(map(int,input().split()))
print(sum(bisect.bisect_left(A,b)*(N-bisect.bisect_right(C,b)) for b in B))