Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [[-1 for i in range(2)] for i in range(51)]
dp[50][0] = 0
for i in range(49, -1, -1):
  mask = 1<<i
  ones = 0
  for e in a:
    if e&mask:
      ones+= 1
  for e in a:
    if dp[i+1][0]!=-1:
      if k&mask:
        dp[i][0] = max(dp[i][0], dp[i+1][0] + mask*(n-ones))
        dp[i][1] = max(dp[i][1], dp[i+1][0] + mask*ones)
      else:
        dp[i][0] = max(dp[i][0], dp[i+1][0] + mask*ones)
    if dp[i+1][1]!=-1:
      dp[i][1] = max(dp[i][1], dp[i+1][1] + mask*max(ones, n-ones))
print(max(dp[0][0], dp[0][1]))

Fixed submission:
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
dp = [[-1 for i in range(2)] for i in range(51)]
dp[50][0] = 0
for i in range(49, -1, -1):
  mask = 1<<i
  ones = 0
  for e in a:
    if e&mask:
      ones+= 1
  for e in a:
    if dp[i+1][0]!=-1:
      if k&mask:
        dp[i][0] = max(dp[i][0], dp[i+1][0] + mask*(n-ones))
        dp[i][1] = max(dp[i][1], dp[i+1][0] + mask*ones)
      else:
        dp[i][0] = max(dp[i][0], dp[i+1][0] + mask*ones)
    if dp[i+1][1]!=-1:
      dp[i][1] = max(dp[i][1], dp[i+1][1] + mask*max(ones, n-ones))
print(max(dp[0][0], dp[0][1]))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
ans = m//n
while m%ans!=0:
  ans -= 1
print(ans)

Fixed submission:
n, m = list(map(int, input().split()))
ans = m//n
while m%ans!=0:
  ans -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, A, B, k = list(map(int, input().split()))

MOD = 998244353
MAX = 210000

fac = [0 for i in range(MAX)]
inv = [0 for i in range(MAX)]
ifac = [0 for i in range(MAX)]
fac[0] = 1; fac[1] = 1
inv[1] = 1
ifac[0] = 1; ifac[1] = 1

for i in range(2, MAX):
  fac[i] = fac[i-1]*i%MOD
  inv[i] = inv[MOD%i]*(MOD-MOD//i)%MOD
  ifac[i] = ifac[i-1]*inv[i]%MOD

def nCk(n, k):
  if n<k or n<0 or k<0: return 0
  return (((fac[n]*ifac[k])%MOD)*ifac[n-k])%MOD

ans = 0
for i in range(n+1):
  if (k-A*i)%B == 0:
    b = (k-A*i)//B
    if 0<=b<=n:
      ans = (ans+nCk(n, i)*nCk(n, b))%MOD

if ans==0:
  print(1)
else:
  print(ans)

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

MOD = 998244353
MAX = n+2

fact, inverse = [0]*(MAX), [0]*(MAX)
fact[0], inverse[0] = 1, 1
for i in range(1, MAX):
  fact[i] = (fact[i-1]*i)%MOD
  inverse[i] = pow(fact[i], MOD-2, MOD)

def mod_comb(n, r):
  if n<r or n==0: return 0
  if r==0: return 1
  return (((fact[n]*inverse[r])%MOD)*inverse[n-r])%MOD

ans = 0
for i in range(n+1):
  if (k-A*i)%B == 0:
    b = (k-A*i)//B
    if 0<=b<=n:
      ans = (ans+mod_comb(n, i)*mod_comb(n, b))%MOD

if ans==0:
  print(1)
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, A, B, k = list(map(int, input().split()))

MOD = 998244353
MAX = n+2

fact, inverse = [0]*(MAX), [0]*(MAX)
fact[0], inverse[0] = 1, 1
for i in range(1, MAX):
  fact[i] = (fact[i-1]*i)%MOD
  inverse[i] = pow(fact[i], MOD-2, MOD)

def mod_comb(n, r):
  if n<r or n==0: return 0
  if r==0: return 1
  return (((fact[n]*inverse[r])%MOD)*inverse[n-r])%MOD

ans = 0
for i in range(n+1):
  if (k-A*i)%B == 0:
    b = (k-A*i)//B
    if 0<=b<=n:
      ans = (ans+mod_comb(n, i)*mod_comb(n, b))%MOD

if ans==0:
  print(1)
else:
  print(ans)

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

MOD = 998244353
MAX = n+2

fact, inverse = [0]*(MAX), [0]*(MAX)
fact[0], inverse[0] = 1, 1
for i in range(1, MAX):
  fact[i] = (fact[i-1]*i)%MOD
  inverse[i] = pow(fact[i], MOD-2, MOD)

def mod_comb(n, r):
  if n<r or n==0: return 0
  if r==0: return 1
  return (((fact[n]*inverse[r])%MOD)*inverse[n-r])%MOD

ans = 0
for i in range(n+1):
  if (k-A*i)%B == 0:
    b = (k-A*i)//B
    if 0<=b<=n:
      ans = (ans+mod_comb(n, i)*mod_comb(n, b))%MOD

if ans==0:
  print(1)
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
ans=3*10^5
for i in range(n):
  ans=min(ans, s[:i].count("W")+s[i+1:].count("E"))
print(ans)

Fixed submission:
n = int(input())
s = input()
cntW = 0
cntE = s[1:].count("E")
ans = cntE
for i in range(1, n):
  if s[i-1] == "W":
    cntW+=1
  if s[i]=="E":
    cntE-=1
  ans=min(ans, cntE+cntW)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans=0

for i in range(n):
  t=a[i]
  ans+=1
  for j in range(i+1, n):
    if t&a[j] == 0:
      t+=a[j]
      ans+=1
    else:
      break

print(ans)

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

t = a[0]
ans = 0
r = 1

for l in range(n):
  while r<n and t^a[r] == t+a[r]:
    t+=a[r]
    r+=1
  if r==l:
    l=r+1
  ans += r-l
  t -= a[l]

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
alphabet = ["abcdefghijklmnopqrstuvwxyz"]
if s == str(alphabet[::-1]):
  print(-1)
else:
  if len(set(s))<26:
    for ele in alphabet:
      if ele not in s:
        print(s+ele)
        break
  else:
    suf=[s[-1]]
    for i in range(len(s)-1, 0, -1):
      if s[i]<s[i-1]:
        suf.append(s[i-1])
      else:
        last = i-1
        break
    suf.sort()
    for i in range(len(suf)):
      if s[last]<suf[i]:
        print(s[:last]+suf[i])
        break

Fixed submission:
s = input()
from string import ascii_lowercase
a = ascii_lowercase
if s == a[::-1]:
  print(-1)
else:
  if len(set(s))<26:
    for ele in a:
      if ele not in s:
        print(s+ele)
        break
  else:
    suf=[s[-1]]
    for i in range(25, 0, -1):
      if s[i]<s[i-1]:
        suf.append(s[i-1])
      else:
        last = i-1
        break
    suf.sort()
    for i in range(len(suf)):
      if s[last]<suf[i]:
        print(s[:last]+suf[i])
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = float("-INF")
f = [[0 for i in range(10)] for i in range(n)]
p = [[0 for i in range(10)] for i in range(n)]
for i in range(n):
  ft = list(map(int, input().split()))
  for j in range(10):
    f[i][j] = ft[j]
for i in range(n):
  pt = list(map(int, input().split()))
  for j in range(10):
    p[i][j] = pt[j]

for i in range(1, 2**10):
  t = 0
  for j in range(n):
    c = 0
    for k in range(10):
      if i>>k&1 and f[j][k]:
        c += 1
    t += p[j][c]
  ans = max(ans, t)
print(ans)

Fixed submission:
n = int(input())
ans = float("-INF")
f = [[0 for i in range(10)] for i in range(n)]
p = [[0 for i in range(11)] for i in range(n)]
for i in range(n):
  ft = list(map(int, input().split()))
  for j in range(10):
    f[i][j] = ft[j]
for i in range(n):
  pt = list(map(int, input().split()))
  for j in range(11):
    p[i][j] = pt[j]

for i in range(1, 2**10):
  t = 0
  for j in range(n):
    c = 0
    for k in range(10):
      if i>>k&1 and f[j][k]:
        c += 1
    t += p[j][c]
  ans = max(ans, t)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, m, R = list(map(int, input().split()))
dist = [[float("INF") if i!=j else 0 for i in range(n)] for j in range(n)]
r = list(map(int, input().split()))
for i in range(m):
  a, b, c = list(map(int, input().split()))
  a, b = a-1, b-1
  dist[a][b] = c
  dist[b][a] = c
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

from itertools import permutations
ans = float("INF")
for e in permutations(r):
  cur = 0
  for i in range(R-1):
    cur += dist[e[i]-1][e[i+1]-1]
  ans = min(ans, cur)
print(ans)

Fixed submission:
n, m, R = list(map(int, input().split()))
dist = [[float("INF") if i!=j else 0 for i in range(n)] for j in range(n)]
r = list(map(int, input().split()))
for i in range(m):
  a, b, c = list(map(int, input().split()))
  a, b = a-1, b-1
  dist[a][b] = c
  dist[b][a] = c
for k in range(n):
  for i in range(n):
    for j in range(n):
      dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

from itertools import permutations
ans = float("INF")
for e in permutations(r):
  cur = 0
  for i in range(R-1):
    cur += dist[e[i]-1][e[i+1]-1]
  ans = min(ans, cur)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a*b//g

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(ans)

Fixed submission:
n = input()
if n[0]==n[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a/g*b

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(int(ans))

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a*b//g

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a*b/g

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(int(ans))

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a*b//g

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

l = t[0]*t[1]/gcd(t[0], t[1])
for i in range(2, n):
  l = t[i]*l/gcd(t[i], l)
print(int(l))

Fixed submission:
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

def lcm(a, b):
  g = gcd(a, b)
  return a*b//g

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
MOD = 10**9+7

def mod_pow(x, n):
  if x==0: return 1
  res = 1
  while n > 0:
    if n&1:
      res = (res*x)%MOD
    x = (x*x)%MOD
    n >>= 1
  return res

fact, invfact = [0]*(10**5+1), [0]*(10**5+1)
fact[0], invfact[0] = 1, 1
for i in range(1, 10**5+1):
  fact[i] = (fact[i-1]*i)%MOD
  invfact[i] = mod_pow(fact[i], MOD-2)%MOD

def comb(n, r):
  if n<r or n==0 or r==0: return 0
  return (((fact[n]*invfact[r])%MOD)*invfact[n-r])%MOD

from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i, ele in enumerate(a):
  if d[ele] == 0:
    d[ele]= i+1
  else:
    l = d[ele]
    r = i+1

print(n)
for k in range(2, n+2):
  print((comb(n+1, k)-comb(l-1+n-r+1, k-1))%MOD)

Fixed submission:
MOD = 10**9+7

def mod_pow(x, n):
  if x==0: return 1
  res = 1
  while n > 0:
    if n&1:
      res = (res*x)%MOD
    x = (x*x)%MOD
    n >>= 1
  return res

fact, invfact = [0]*(10**5+2), [0]*(10**5+2)
fact[0], invfact[0] = 1, 1
for i in range(1, 10**5+2):
  fact[i] = (fact[i-1]*i)%MOD
  invfact[i] = mod_pow(fact[i], MOD-2)%MOD

def comb(n, r):
  if n<r or n==0 or r==0: return 0
  return (((fact[n]*invfact[r])%MOD)*invfact[n-r])%MOD

from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for i, ele in enumerate(a):
  if d[ele] == 0:
    d[ele]= i+1
  else:
    l = d[ele]
    r = i+1

print(n)
for k in range(2, n+2):
  print((comb(n+1, k)-comb(l-1+n-r+1, k-1))%MOD)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
graph = [float("INF") for i in range(n)]
graph[0] = 0
edge = [tuple(map(int, input().split())) for i in range(m)]
for i in range(2*n):
  flag = False
  for e in edge:
    a, b, c = e
    a, b, c = a-1, b-1, -c
    if graph[b] > graph[a]+c:
      if b==n-1:
        flag = True
      graph[b] = graph[a]+c
if flag:
  print("inf")
else:
  print(-graph[n-1])

Fixed submission:
n, m = list(map(int, input().split()))
graph = [float("INF") for i in range(n)]
graph[0] = 0
edge = [tuple(map(int, input().split())) for i in range(m)]
for i in range(2*n):
  flag = False
  for e in edge:
    a, b, c = e
    a, b, c = a-1, b-1, -c
    if graph[b] > graph[a]+c:
      if b==n-1:
        flag = True
      graph[b] = graph[a]+c
if flag:
  print("inf")
else:
  print(-graph[n-1])
Buggy python submission (verdict: Runtime Error):
n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
dp = [[[0 for _ in range(n*max(x)+1)] for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1

for j in range(1, n+1):
  for k in range(n+1):
    for s in range(n*max(x)+1):
      if s<x[j-1]:
        dp[j][k][s] = dp[j-1][k][s]
      elif k>=1:
        dp[j][k][s] = dp[j-1][k][s]+dp[j-1][k-1][s-x[j-1]]
ans = 0
for i in range(1, n+1):
  ans += dp[n][i][i*a]
print(ans)

Fixed submission:
n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
y = [ele-a for ele in x]
m = n*max(a, max(x))
dp = [[0 for _ in range(2*m+1)]for _ in range(n+1)]
dp[0][m] = 1
for j in range(1, n+1):
  for t in range(2*m+1):
    if t-y[j-1]<0 or 2*m<t-y[j-1]:
      dp[j][t] = dp[j-1][t]
    elif 0<=t-y[j-1]<=2*m:
      dp[j][t] = dp[j-1][t] + dp[j-1][t-y[j-1]]
print(dp[n][m]-1)

Buggy python submission (verdict: Runtime Error):
n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
dp = [[[0 for _ in range(n*max(x)+1)] for _ in range(n+1)] for _ in range(n+1)]
dp[0][0][0] = 1

for j in range(1, n+1):
  for k in range(n+1):
    for s in range(n*max(x)+1):
      if s<x[j-1]:
        dp[j][k][s] = dp[j-1][k][s]
      elif k>=1:
        dp[j][k][s] = dp[j-1][k][s]+dp[j-1][k-1][s-x[j-1]]
ans = 0
for i in range(1, n+1):
  ans += dp[n][i][i*a]
print(ans)

Fixed submission:
n, a = list(map(int, input().split()))
x = list(map(int, input().split()))
y = [ele-a for ele in x]
m = n*max(a, max(x))
dp = [[0 for _ in range(2*m+1)]for _ in range(n+1)]
dp[0][m] = 1
for j in range(1, n+1):
  for t in range(2*m+1):
    if t-y[j-1]<0 or 2*m<t-y[j-1]:
      dp[j][t] = dp[j-1][t]
    elif 0<=t-y[j-1]<=2*m:
      dp[j][t] = dp[j-1][t] + dp[j-1][t-y[j-1]]
print(dp[n][m]-1)
Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
ans = 0
for idx in range(len(li)-1):
    ans += li[idx] * sum(li[idx+1:])

print(ans % MOD_NUMBER)


Fixed submission:

N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
nizyo_list = [i**2 for i in li]
ans = (sum(li)**2-sum(nizyo_list))//2
print(ans % MOD_NUMBER)

Buggy python submission (verdict: Time Limit Exceeded):

import itertools


N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
ans = 0
for idx in range(len(li)-1):
    ans += li[idx] * sum(li[idx+1:])

print(ans % MOD_NUMBER)


Fixed submission:

N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
nizyo_list = [i**2 for i in li]
ans = (sum(li)**2-sum(nizyo_list))//2
print(ans % MOD_NUMBER)

Buggy python submission (verdict: Time Limit Exceeded):

import itertools


N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
moded_li = []
for i in li:
    ans = i % MOD_NUMBER
    if ans != 0:
        moded_li.append(ans)
ans = 0
for idx in range(len(moded_li)-1):
    ans += moded_li[idx] * sum(moded_li[idx+1:])

print(ans % MOD_NUMBER)


Fixed submission:

N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
nizyo_list = [i**2 for i in li]
ans = (sum(li)**2-sum(nizyo_list))//2
print(ans % MOD_NUMBER)

Buggy python submission (verdict: Time Limit Exceeded):

import itertools


N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
moded_li = []
for i in li:
    ans = i % MOD_NUMBER
    if ans != 0:
        moded_li.append(ans)
ans = 0
for i in itertools.combinations(moded_li, 2):
    # print(i)
    ans += i[0]*i[1]
print(ans % MOD_NUMBER)


Fixed submission:

N = int(input())
li = list(map(int, input().split()))
MOD_NUMBER = 10**9+7
nizyo_list = [i**2 for i in li]
ans = (sum(li)**2-sum(nizyo_list))//2
print(ans % MOD_NUMBER)
Buggy python submission (verdict: Time Limit Exceeded):
def check_road(start, road_array, mark_array):
    search_target = []
    search_target.append(start)

    while len(search_target) > 0:
        target = search_target[0]
        for road in road_array:
            if target in road and mark_array[road[abs(1-road.index(target))]] is None and road[abs(1-road.index(target))] != 1:
                # 逆側の要素を返す
                # print('{}を探している、次は{}へ移動'.format(
                #     target, road[abs(1-road.index(target))]))
                mark_array[road[abs(1-road.index(target))]] = target
                search_target.append(road[abs(1-road.index(target))])
        del search_target[0]


# 部屋の数 通路の数
N, M = map(int, input().split())
road_array = []
for i in range(M):
    road_array.append(list(map(int, input().split())))
mark_array = [None] * (N+1)
check_road(1, road_array, mark_array)
mark_array = mark_array[2:]

if None in mark_array:
    print('No')
else:
    print('Yes')
    for mark in mark_array:
        print(mark)


Fixed submission:
def check_road(start, road_array, mark_array):
    search_target = []
    search_target.append(start)

    while len(search_target) > 0:
        target = search_target[0]
        if len(road_array[target]) != 0:
            for road in road_array[target]:
                if road is not None and mark_array[road] is None and road != 1:
                    # 逆側の要素を返す
                    # print('{}を探している、次は{}へ移動'.format(
                    #     target, road[abs(1-road.index(target))]))
                    mark_array[road] = target
                    search_target.append(road)
        del search_target[0]


# 部屋の数 通路の数
N, M = map(int, input().split())
road_array = [[None] for i in range(N+1)]
# for i in road_array:
#     print(i)
#     print(len(road_array))
for i in range(M):
    a, b = map(int, input().split())
    tmp_a = road_array[a]
    tmp_b = road_array[b]
    # print('チェック{}'.format(i))
    # print('チェック{}'.format(tmp_a))
    # print('チェック{}'.format(tmp_b))
    tmp_a.append(b)
    tmp_b.append(a)
    road_array[a] = tmp_a
    road_array[b] = tmp_b

mark_array = [None] * (N+1)
check_road(1, road_array, mark_array)
mark_array = mark_array[2:]

if None in mark_array:
    print('No')
else:
    print('Yes')
    for mark in mark_array:
        print(mark)
Buggy python submission (verdict: Runtime Error):
rating = input()
if rating >= 0 and rating < 1200:
    print('ABC')
elif rating >= 1200 and rating < 2800:
    print('ARC')
else:
    print('AGC') 


Fixed submission:
rating = int(input())
if rating >= 0 and rating < 1200:
    print('ABC')
elif rating >= 1200 and rating < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
flg = True
for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)]+T[1:]
else:
    print('No')


Fixed submission:
S = input()
T = input()

for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)-1]+T[0:len(T)-1]
else:
    print('No')

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

for i in range(0,len(S)):
	if S[i] == T[-i]:
		continue
	else:
		print('No')
		return

print('Yes')


Fixed submission:
S = input()
T = input()

for i in range(0,len(S)):
    if S == T:
        print('Yes')
        break
    else:
        T = T[len(T)-1]+T[0:len(T)-1]
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
size = int(input())
A = list(map(int,input().split()))
i = list(range(1,size+1))

remain_list = [A-i for(A,i) in zip(A,i)]
while(True):
    zero_count = len([i for i in remain_list if i ==0])
    minus_count = len([i for i in remain_list if i <0])
    plus_count = len([i for i in remain_list if i > 0])

    if zero_count == max(zero_count,minus_count,plus_count) or plus_count == minus_count:
        break

    if plus_count == max(zero_count,minus_count,plus_count):
        remain_list = [num - 1 for num in remain_list]

    if minus_count == max(zero_count,minus_count,plus_count):
        remain_list = [num + 1 for num in remain_list]


sum_list =[abs(num) for num in remain_list]

print(sum(sum_list))


Fixed submission:
num = int(input())
if num % 2 != 0:
    print(num*2)
else:
    print(num)

Buggy python submission (verdict: Runtime Error):
size = int(input())
A = list(map(int,input().split()))
i = list(range(1,size+1))

remain_list = [A-i for(A,i) in zip(A,i)]
while(True):
    zero_count = len([i for i in remain_list if i ==0])
    minus_count = len([i for i in remain_list if i <0])
    plus_count = len([i for i in remain_list if i > 0])

    if zero_count == max(zero_count,minus_count,plus_count) or plus_count == minus_count:
        break

    if plus_count == max(zero_count,minus_count,plus_count):
        remain_list = [num - 1 for num in remain_list]

    if minus_count == max(zero_count,minus_count,plus_count):
        remain_list = [num + 1 for num in remain_list]


sum_list =[abs(num) for num in remain_list]

print(sum(sum_list))


Fixed submission:
num = int(input())
if num % 2 != 0:
    print(num*2)
else:
    print(num)
Buggy python submission (verdict: Runtime Error):
numA numB = input()
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')


Fixed submission:
numA,numB = map(int,input().split())
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
numA numB = input()
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')


Fixed submission:
numA,numB = map(int,input().split())
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
numA numB = input()
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')


Fixed submission:
numA,numB = map(int,input().split())
if(numA <=8 and numB <= 8):
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
D,N =map(int,input().split())
if D ==0:
    print(N)
elif D == 1 and N <100:
    print(N*100)
elif D ==1 and N ==100:
    print(N+1)*100

elif D == 2 and N <100:
    print(10000*N)
elif D == 2 and N==100:
    print(N+1)*100


Fixed submission:
D,N =map(int,input().split())
if D ==0 and N <100:
    print(N)
elif D ==0 and N ==100:
    print(N+1)
elif D == 1 and N <100:
    print(N*100)
elif D ==1 and N ==100:
    print((N+1)*100)

elif D == 2 and N <100:
    print(10000*N)
elif D == 2 and N==100:
    print((N+1)*10000)

Buggy python submission (verdict: Runtime Error):
D N =input()
if D ==0:
    print(N)
elif D == 1:
    print(N*100)
elif D == 2:
    print(N*10000)

Fixed submission:
D,N =map(int,input().split())
if D ==0 and N <100:
    print(N)
elif D ==0 and N ==100:
    print(N+1)
elif D == 1 and N <100:
    print(N*100)
elif D ==1 and N ==100:
    print((N+1)*100)

elif D == 2 and N <100:
    print(10000*N)
elif D == 2 and N==100:
    print((N+1)*10000)