Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print(max([function(A, B, i) for i in range(max([1, N-N%B-1]), N+1)]))

Fixed submission:
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print(max([function(A, B, N), function(A, B, max([1, N-N%B-1]))]))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print(max([function(A, B, i) for i in range(max([1, N-B]), N+1)]))

Fixed submission:
A, B, N = list(map(int, input().split()))
def function(a, b, x):
  return (a*x)//b - a*(x//b)
print(max([function(A, B, N), function(A, B, max([1, N-N%B-1]))]))
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
GCD = [[math.gcd(i, j) for i in range(1, 10)] for j in range(1, 10)]
all_gcd = [GCD[GCD[i][j]][m] for i in range(1, N+1) for j in range(1, N+1) for m in range(1, N+1)]
print(sum(all_gcd))


Fixed submission:
import math
N = int(input())
all_gcd = []
for i in range(1, N+1):
  for j in range(1, N+1):
    x = math.gcd(i, j) if i != j else i
    for m in range(1, N+1):
      y = math.gcd(x, m) if x != m else x
      all_gcd.append(y)

print(sum(all_gcd))
Buggy python submission (verdict: Time Limit Exceeded):
N, X, Y = list(map(int, input().split()))
result = {N-i:0 for i in range(1, N)}

for i in range(1, N):
  for j in range(i + 1, N + 1):
    dis = min([j - i, abs(j - Y) + abs(i - X) + 1, abs(j - X) + abs(i - Y) + 1])
    result[dis] += 1
print("\n".join(list(map(str, result.values()))))

Fixed submission:
N, X, Y = list(map(int, input().split()))
result = {N-i:0 for i in range(1, N)}

for i in range(1, N):
  for j in range(i + 1, N + 1):
    dis = min([j - i, abs(j - Y) + abs(i - X) + 1, abs(j - X) + abs(i - Y) + 1])
    result[dis] += 1
print("\n".join(list(map(str, result.values()))))
Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
print((N/3)**3)

Fixed submission:
N = int(input())
print((N/3)**3)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <cmath>
using namespace std;

int main(void){
  long long int a, b;
  cin >> a >> b;
  if(a % 2 == 1 && b % 2 == 1){
    cout << (long long int)((long long int)(b*a)/(long long int)2 + 1) << endl;
  }
  else{
    cout << (long long int)((long long int)(b*a)/(long long int)2) << endl;
  }
  
  return 0;
}


Fixed submission:
N = list(map(int, input().split()))
if N[0] == 1 or N[1] == 1:
  print(1)
else:
  print((N[0]*N[1]+1)//2)
Buggy python submission (verdict: Runtime Error):
N = list(map(int, input().split()))
print((N[0]//(N[1]+N[2])*N[1] + min([N[0]%(N[1]+N[2]), N[1]]))

Fixed submission:
N = list(map(int, input().split()))
print((N[0]//(N[1]+N[2]))*N[1] + min([N[0]%(N[1]+N[2]), N[1]]))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      S = X[2] + S
    else:
      S += X[2]
print(S) if direct == 0 else print(S[::-1])


Fixed submission:
S = input()
f = ""
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      f += X[2]
    else:
      S += X[2]
print(f[::-1]+S) if direct == 0 else print(S[::-1]+f)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      S = X[2] + S
    else:
      S = S + X[2]
print(S) if direct == 0 else print(S[::-1])


Fixed submission:
S = input()
f = ""
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      f += X[2]
    else:
      S += X[2]
print(f[::-1]+S) if direct == 0 else print(S[::-1]+f)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = int(input())
for i in range(N):
  X = input().split()
  if len(X) == 1:
    NS = S[::-1]
  else:
    if X[1] == "1":
      NS = X[2] + S
    else:
      NS = S + X[2]
  S = NS
print(S)


Fixed submission:
S = input()
f = ""
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      f += X[2]
    else:
      S += X[2]
print(f[::-1]+S) if direct == 0 else print(S[::-1]+f)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = int(input())
for i in range(N):
  X = input().split()
  if len(X) == 1:
    NS = S[::-1]
  else:
    if X[1] == "1":
      NS = X[2] + S
    else:
      NS = S + X[2]
  S = NS
print(S)


Fixed submission:
S = input()
f = ""
N = int(input())
direct = 0
for i in range(N):
  X = input().split()
  if len(X) == 1:
    direct = 1 - direct
  else:
    if (X[1] == "1" and direct == 0) or (X[1] == "2" and direct == 1):
      f += X[2]
    else:
      S += X[2]
print(f[::-1]+S) if direct == 0 else print(S[::-1]+f)
Buggy python submission (verdict: Time Limit Exceeded):
x = list(map(int, input().split()))
y = list(map(int, input().split()))
y = [i/2+0.5 for i in y]
max_value = 0
for i in range(0, x[0]-x[1]+1):
  value = sum(y[i:i+x[1]])
  max_value = max(max_value, value)
print(max_value)

Fixed submission:
x = list(map(int, input().split()))
y = list(map(int, input().split()))
y = [i/2+0.5 for i in y]
max_value = 0
value = sum(y[:x[1]])
for i in range(x[1], x[0]):
  max_value = max(max_value, value)
  value += y[i]
  value -= y[i-x[1]]
max_value = max(max_value, value)
print(max_value)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 1:
  print(0)
else:
  # i = 5 で始めると奇数が入る
  i = 10
  result = 0
  while N > i:
    result += N//i
    i *= 5
print(result) 


Fixed submission:
N = int(input())
if N % 2 == 1:
  print(0)
else:
  i = 10
  result = 0
  while N >= i:
    result += N//i
    i *= 5
  print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int, input().split()))
M = [bin(m)[2:] for m in M]
max_len = max([len(m) for m in M])
M = ["0"*(max_len-len(m))+m for m in M]
MOD = 10**9+7
result = 0
for i in range(1, max_len+1):
  zero = len([m[-i] for m in M if m[-i]=="0"])
  one = len(M) - zero
  #print(one, zero, i)
  result += (((one * zero) % MOD) * ((2 ** (i-1)) % MOD) % MOD)
  result %= MOD
print(result)

Fixed submission:
N = int(input())
M = list(map(int, input().split()))
M = [bin(m)[2:] for m in M]
max_len = max([len(m) for m in M])
M = ["0"*(max_len-len(m))+m for m in M]
MOD = 10**9+7
result = 0
for i in range(1, max_len+1):
  zero = len([m[-i] for m in M if m[-i]=="0"])
  one = len(M) - zero
  #print(one, zero, i)
  result += (((one * zero) % MOD) * ((2 ** (i-1)) % MOD) % MOD)
  result %= MOD
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Fixed submission:
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    #はー，二分探索掛けないんごー
    l, r = j, N
    while (r - l) > 1:
      c = (l + r + 1) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Fixed submission:
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Fixed submission:
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    lower = b-a
    upper = a+b
    for l in range(j+1, N):
      c = M[l]
      if c < lower:
        continue
      if c >= a+b:
        break
      count += 1
      
print(count)

Fixed submission:
N = int(input())
M = list(map(int, input().split()))
M = sorted(M)
count = 0
for i in range(N):
  a = M[i]
  for j in range(i+1, N):
    b = M[j]
    upper = a+b
    l, r = j, N
    while (r - l) > 1:
      c = (l + r) // 2
      if M[c] < upper:
        l = c
      else:
        r = c  
    #print(count, j, l, r)
    count += l - j
      
print(count)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
import math
import numpy as np
N = list(map(int, input().split()))
g = gcd(N[0], N[1])

prime = [1]
for i in range(2, g+1):
  while g % i == 0:
    g /= i
    prime.append(i)
print(len(set(prime)))


Fixed submission:
N = int(input())
print((N-N//2)/N)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, input().split()))
indexed_S = sorted([i,s for i,s in enumerate(S)], key = lambda x: x[1])
print(" ".join([iS[0] for iS in indexed_S])

Fixed submission:
N = int(input())
S = list(map(int, input().split()))
indexed_S = sorted([[i,s] for i,s in enumerate(S)], key = lambda x: x[1])
print(" ".join([str(iS[0]+1) for iS in indexed_S]))
Buggy python submission (verdict: Runtime Error):
import queue
q = queue.PriorityQueue()
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
for a in A:
  q.put((-a, a))

while M > 0:
  item = q.get()
  if item[1] == 0:
    break
  q.put((-item[1]//2, item[1]//2))
  M -= 1

result = 0
while not q.empty():
  result += q.get()[1]a
print(result)

Fixed submission:
import queue
MAXIMUM = 10 ** 10
q = queue.PriorityQueue()
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
for a in A:
  q.put((-a, a))

while M > 0:
  item = q.get()
  if item[1] == 0:
    break
  q.put((-int(item[1]/2), int(item[1]/2)))
  M -= 1

result = 0
while not q.empty():
  result += q.get()[1]
print(result)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
print(len([1 for i in range(3) if S[i]==T[i]])

Fixed submission:
S = input()
T = input()
print(len([1 for i in range(3) if S[i]==T[i]]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
print(sum([i for i in range(N)]))

Fixed submission:
N = int(input())
print((N-1) * N // 2)
Buggy python submission (verdict: Runtime Error):
print("red") if int(input()) < 3200 else print("pink"

Fixed submission:
N = int(input())
S = input()
print("red") if N < 3200 else print(S)
Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
info = [list(map(int, input().split())) for i in range(N)]
info = sorted(info, key=lambda x:(x[0], x[1]), reverse=True)
#print(info)

result = 0
for j in range(len(info)):
    if info[j][0] <= M:
      #print(info[j], i)
      result += info[j][1]
      M -= 1
    if M == 0:
      break
print(result)


Fixed submission:
A, B = list(map(int, input().split()))
print(max([A+B, A-B, A*B]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_list = []
for i in range(N):
  str_dict = {}
  for j in input():
    if j in str_dict:
      str_dict[j] += 1
    else:
      str_dict[j] = 1
  str_list.append(str_dict)
  
count = 0
for i in range(N):
  for j in range(i+1, N):
    if str_list[i] == str_list[j]:
      count += 1
print(count)


Fixed submission:
N = int(input())
str_list = {}
for i in range(N):
  str_dict = {}
  for j in input():
    if j in str_dict:
      str_dict[j] += 1
    else:
      str_dict[j] = 1
  key = "".join([str(k)+str(v) for k, v in sorted(str_dict.items(), key=lambda x:x[0])])
  if key in str_list:
    str_list[key] += 1
  else:
    str_list[key] = 1
  
result = sum([i*(i-1)//2 for i in str_list.values()])
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_list = []
for i in range(N):
  str_dict = {}
  for j in input():
    if j in str_dict:
      str_dict[j] += 1
    else:
      str_dict[j] = 1
  str_list.append(str_dict)
  
count = 0
for i in range(N):
  for j in range(i+1, N):
    if str_list[i] == str_list[j]:
      count += 1
print(count)

Fixed submission:
N = int(input())
str_list = {}
for i in range(N):
  str_dict = {}
  for j in input():
    if j in str_dict:
      str_dict[j] += 1
    else:
      str_dict[j] = 1
  key = "".join([str(k)+str(v) for k, v in sorted(str_dict.items(), key=lambda x:x[0])])
  if key in str_list:
    str_list[key] += 1
  else:
    str_list[key] = 1
  
result = sum([i*(i-1)//2 for i in str_list.values()])
print(result)
Buggy python submission (verdict: Runtime Error):
N = int(input())
for i in range(N//2, N+1):
  if N % i == 0:
    print(0, 0, 0, N//i, i, 0)
    break

Fixed submission:
L = 10 ** 9
N = int(input())
y = (N - 1) // L + 1
x = (L - N) % L
print(0, 0, L, 1, x, y)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
D = list(map(int, input().split()))

argminD = 0#np.argmin(D)
for i in range(0, D[argminD]*2+1, 2):
  first = int(i)
  final = D[argminD]*2 - int(i)
  for j in range(argminD+1, N+argminD):
    j = j % N
    final = D[j]*2-final
    if final < 0:
      break
  if first == final:
    result = [str(first)]
    final = D[argminD]*2 - first
    for j in range(argminD+1, N+argminD):
      j = j % N
      result.append(str(final))
      final = D[j]*2-final
    print(" ".join(result))
    #print(" ".join(result[argminD:]) + " " + " ".join(result[:argminD]))
    sys.exit(0)
  

Fixed submission:
import numpy as np
import sys
N = int(input())
D = np.asarray(list(map(int, input().split())))

first = np.sum(D) - np.sum(D[1::2])*2
result = [str(first)]
final = D[0]*2 - first
for j in range(1, N):
  result.append(str(final))
  final = D[j]*2-final
print(" ".join(result))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
N = int(input())
D = list(map(int, input().split()))

argminD = 0#np.argmin(D)
for i in range(0, D[argminD]*2+1, 2):
  first = int(i)
  final = D[argminD]*2 - int(i)
  for j in range(argminD+1, N+argminD):
    j = j % N
    final = D[j]*2-final
    if final < 0:
      break
  if first == final:
    result = [str(first)]
    final = D[argminD]*2 - first
    for j in range(argminD+1, N+argminD):
      j = j % N
      result.append(str(final))
      final = D[j]*2-final
    print(" ".join(result))
    sys.exit(0)
  

Fixed submission:
import numpy as np
import sys
N = int(input())
D = np.asarray(list(map(int, input().split())))

first = np.sum(D) - np.sum(D[1::2])*2
result = [str(first)]
final = D[0]*2 - first
for j in range(1, N):
  result.append(str(final))
  final = D[j]*2-final
print(" ".join(result))
Buggy python submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

MOD = 10**9+7
N, K = list(map(int, input().split()))

for i in range(K):
  #first N-K+1
  blue = combinations_count(K-1, i)
  red = combinations_count(N-K+1, i+1)
  print(blue*red%MOD)

Fixed submission:
import math
def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

MOD = 10**9+7
N, K = list(map(int, input().split()))

for i in range(K):
  if K-1 >= i and N-K+1 >= i+1:
    blue = combinations_count(K-1, i)
    red = combinations_count(N-K+1, i+1)
    print(blue*red%MOD)
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
r, D, x0 = list(map(int, input().split()))
for i in range(10):
  x1 = r * x - D
  x = x1
  print(x1)

Fixed submission:
r, D, x0 = list(map(int, input().split()))
for i in range(10):
  x1 = r * x0 - D
  x0 = x1
  print(x1)

Buggy python submission (verdict: Runtime Error):
r, D, x0 = list(map(int, input().split()))
for i in range():
  x1 = r * x - D
  x = x1
  print(x1)

Fixed submission:
r, D, x0 = list(map(int, input().split()))
for i in range(10):
  x1 = r * x0 - D
  x0 = x1
  print(x1)
Buggy python submission (verdict: Runtime Error):
import math
N, K = list(map(int, input().split()))
result = 0
for i in range(1, N+1):
  result += (1/N) * 0.5 ** (math.floor(math.log(K//i, 2))+1)
print("{:.12}".format(result))

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

i = 1
result = 0
for i in range(1, N+1):
  temp = 1 / N
  now = i
  while now < K:
    now *= 2
    temp *= 0.5
  result += temp
  
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = list(map(int, input().split()))

count = 0
for i in range(0, N+1, R):
    for j in range(0, N+1, G):
        if (N-i-j) % B == 0 and N >= (i+j):
            count += 1
print(count)

Fixed submission:
R, G, B, N = list(map(int, input().split()))
 
count = len([1 for i in range(0, N+1, R) for j in range(0, N+1, G) if (N-i-j) % B == 0 and N >= (i+j)])
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
 
result = 0
for i in range(1, int(N**0.5)+1):
  # 偽物が通ってしまう．sample 2 の時，999999ずれる
  if (N - i) % i == 0:
    temp = (N - i) // i
    if N // temp == N % temp:
      result += temp

print(int(result))

Fixed submission:
N = int(input())

result = 0
for i in range(1, int(N**0.5)+1):
  if N % i == 0:
    for j in set([i, N//i]):
      num = j - 1
      if num != 0 and N // num == N % num:
        result += num

print(int(result))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
b, w = 0, 0
for i in range(len(S)):
  if S[i] == ".":
    w += 1
  else:
    b += 1
  if S[i:i+2] == "#.":
    arr.append(b)
  if S[i:i+2] == ".#":
    arr.append(w)
if S[-1] == ".":
	arr.append(w)
#print(arr)
 
result = arr[-1]+arr[1]
for i in range(0, len(arr), 2):
  result = min([arr[i]+arr[-1]-arr[i+1], result])

print(result)

Fixed submission:
N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
b, w = 0, 0
for i in range(len(S)):
  if S[i] == ".":
    w += 1
  else:
    b += 1
  if S[i:i+2] == "#.":
    arr.append(b)
  if S[i:i+2] == ".#":
    arr.append(w)
if S[-1] == ".":
  arr.append(w)
#print(arr)
 
result = w
for i in range(0, len(arr), 2):
  result = min([arr[i]+w-arr[i+1], result])

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
count = 0
for i in range(len(S)):
  count += 1
  if S[i:i+2] == "#.":
    arr.append(count)
    count = 0  
  if S[i:i+2] == ".#":
    arr.append(count)
    count = 0
if S[-1] == ".":
  arr.append(count)
#print(arr)
 
result = sum([min(arr[i:i+2]) for i in range(0, len(arr)+1, 2)])
print(result)

Fixed submission:
N = int(input())
S = input()
 
arr = [0] if S[0] == "." else []
b, w = 0, 0
for i in range(len(S)):
  if S[i] == ".":
    w += 1
  else:
    b += 1
  if S[i:i+2] == "#.":
    arr.append(b)
  if S[i:i+2] == ".#":
    arr.append(w)
if S[-1] == ".":
  arr.append(w)
#print(arr)
 
result = w
for i in range(0, len(arr), 2):
  result = min([arr[i]+w-arr[i+1], result])

print(result)
Buggy python submission (verdict: Runtime Error):
A = [int(input()) for i in range(5)]
k = int (input())
min_dis = [abs(A[i] - A[j]) for i in range(5) for j in range(i+1, 5)]
print(":(") if min_dis > k else print("Yay!")

Fixed submission:
A = [int(input()) for i in range(5)]
k = int (input())
max_dis = max([abs(A[i] - A[j]) for i in range(5) for j in range(i+1, 5)])
print(":(") if max_dis > k else print("Yay!")
Buggy python submission (verdict: Runtime Error):
inp = input()
res = 0
for i in range(len(inp)):
	for j in range(i, len(inp)):
    	if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
        	res = max(res, j-i)
print(res)

Fixed submission:
inp = input()
res = 0
for i in range(len(inp)+1):
  for j in range(i+1, len(inp)+1):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [i+j+k+l+m+n+o+p+q+r+s for i in ACGT for j in ACGT for k in ACGT for l in ACGT for m in ACGT for n in ACGT for o in ACGT for p in ACGT for q in ACGT for r in ACGT for s in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

Fixed submission:
inp = input()
res = 0
for i in range(len(inp)+1):
  for j in range(i+1, len(inp)+1):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)

Buggy python submission (verdict: Runtime Error):
import numpy as np
inp = input()
ACGT = ["", "A", "C", "G", "T"]
sentences = [j+K+m+n for j in ACGT for k in ACGT for m in ACGT for n in ACGT]
length = [len(sent) for sent in sentences if sent in inp]
print(np.max(length))

Fixed submission:
inp = input()
res = 0
for i in range(len(inp)+1):
  for j in range(i+1, len(inp)+1):
    if len([w for w in inp[i:j] if w in ["A", "C", "G", "T"]]) == (j-i):
      res = max(res, j-i)
print(res)