Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
a.sort()
d = [1000000000]
e = []
flg = False
for i in range(len(a)-1):
  t = a[1+i] - a[i]
  e.append(t)
  if(t < d[0]):
    d.insert(0,t)
  if(t == 1):
    flg = True
    break
if(flg):
  print(1)
else:
  k = d[0]
  j = 2
  while True:
    s = int(k/j)
    if(k % j == 0):
      d.append(s)
    if(s < 1):
      break
    j += 1

  d.sort()
  l = len(d)
  ans = 1
  for i in range(l):
    u = list(map(lambda x: x% d[l - 1 - i],e))
    if(u.count(0) == n):
      ans = d[l-1-i]
      break
  print(ans)

Fixed submission:
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
a.sort()
d = [1000000000]
e = []
flg = False
for i in range(len(a)-1):
  t = a[1+i] - a[i]
  e.append(t)
  if(t < d[0]):
    d.insert(0,t)
  if(t == 1):
    flg = True
    break
if(flg):
  print(1)
else:
  d.sort()
  l = len(d)
  ans = 1
  for i in range(l):
    u = list(map(lambda x: x% d[l - 1 - i],e))
    if(u.count(0) == n):
      ans = d[l-1-i]
      break
  if(ans == 1):
    k = d[0]
    f = []
    j = 2
    while True:
      s = int(k/j)
      if(k % j == 0):
        f.insert(0,s)
      if(s < 1):
        break
      j += 1
    q = len(f)
    for i in range(q):
      u = list(map(lambda x: x% f[q - 1 - i],e))
      if(u.count(0) == n):
        ans = f[q-1-i]
        break

  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
a.sort()
d = [1000000000]
e = []
flg = False
for i in range(len(a)-1):
  t = a[1+i] - a[i]
  e.append(t)
  if(t < d[0]):
    d.insert(0,t)
  if(t == 1):
    flg = True
    break
if(flg):
  print(1)
else:
  for i in range(1,int(d[0]/2)+1):
    if(d[0]%i==0):
      d.append(i)
  d.sort()
  l = len(d)
  ans = 1
  for i in range(l):
    u = list(map(lambda x: x% d[l - 1 - i],e))
    if(u.count(0) == n):
      ans = d[l-1-i]
      break
  print(ans)

Fixed submission:
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.append(x)
a.sort()
d = [1000000000]
e = []
flg = False
for i in range(len(a)-1):
  t = a[1+i] - a[i]
  e.append(t)
  if(t < d[0]):
    d.insert(0,t)
  if(t == 1):
    flg = True
    break
if(flg):
  print(1)
else:
  d.sort()
  l = len(d)
  ans = 1
  for i in range(l):
    u = list(map(lambda x: x% d[l - 1 - i],e))
    if(u.count(0) == n):
      ans = d[l-1-i]
      break
  if(ans == 1):
    k = d[0]
    f = []
    j = 2
    while True:
      s = int(k/j)
      if(k % j == 0):
        f.insert(0,s)
      if(s < 1):
        break
      j += 1
    q = len(f)
    for i in range(q):
      u = list(map(lambda x: x% f[q - 1 - i],e))
      if(u.count(0) == n):
        ans = f[q-1-i]
        break

  print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())
a = int(n/k)
if(a < 2):
    b = 0
else:
    b = math.factorial(a) // (math.factorial(a - 2) * 2)
if(a < 3):
    c = 0
else:
    j = math.factorial(a-3)
    c = math.factorial(a) // j * 6
ans = a + b * 6 + c * 6
if(k % 2 == 0):
    t = int(k / 2)
    if(a * k + t > n):
      ans = ans * 2
    else:
      d = a + 1
      if(d < 2):
          e = 0
      else:
          e = math.factorial(d) // j * 2
      if(d < 3):
          f = 0
      else:
          f = math.factorial(d) // (math.factorial(d - 3) * 6)
      ans += (d + e * 6 + f * 6)
print(ans)

Fixed submission:
import math

n, k = map(int, input().split())

ans = int(math.pow(int(n/k),3))

if(k % 2 == 0):
  m = int( (n+int(k/2))/ k )
  ans += int(math.pow(m,3))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n, k = map(int, input().split())
a = int(n/k)
if(a < 2):
    b = 0
else:
    b = math.factorial(a) // (math.factorial(a - 2) * math.factorial(2))
if(a < 3):
    c = 0
else:
    c = math.factorial(a) // (math.factorial(a - 3) * math.factorial(3))
ans = a + b * 6 + c * 6
if(k % 2 == 0):
    t = int(k / 2)
    if(a * k + t > n):
      ans = ans * 2
    else:
      d = a + 1
      if(d < 2):
          e = 0
      else:
          e = math.factorial(d) // (math.factorial(d - 2) * math.factorial(2))
      if(d < 3):
          f = 0
      else:
          f = math.factorial(d) // (math.factorial(d - 3) * math.factorial(3))
      ans += (d + e * 6 + f * 6)
print(ans)

Fixed submission:
import math

n, k = map(int, input().split())

ans = int(math.pow(int(n/k),3))

if(k % 2 == 0):
  m = int( (n+int(k/2))/ k )
  ans += int(math.pow(m,3))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n, k = map(int, input().split())
a = int(n/k)
if(a < 2):
    b = 0
else:
    b = math.factorial(a) // (math.factorial(a - 2) * math.factorial(2))
if(a < 3):
    c = 0
else:
    c = math.factorial(a) // (math.factorial(a - 3) * math.factorial(3))
ans = a + b * 6 + c * 6
if(k % 2 == 0):
    t = int(k / 2)
    if(a * k + t > n):
      d = a
    else:
      d = a+ 1


    if(d < 2):
        e = 0
    else:
        e = math.factorial(d) // (math.factorial(d - 2) * math.factorial(2))
    if(d < 3):
        f = 0
    else:
        f = math.factorial(d) // (math.factorial(d - 3) * math.factorial(3))
    ans += (d + e * 6 + f * 6)
print(ans)

Fixed submission:
import math

n, k = map(int, input().split())

ans = int(math.pow(int(n/k),3))

if(k % 2 == 0):
  m = int( (n+int(k/2))/ k )
  ans += int(math.pow(m,3))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input().rstrip().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
k = int(s[3])

for i in range(k):
  n_a = b+c
  n_b = a+c
  n_c = a+b
  a = n_a
  b = n_b
  c = n_c
  if(a == b and b == c ):
    break

d = a - b
if(abs(d) < 100000000):
  print(a-b)
else:
  print("Unfair")

Fixed submission:
s = input().rstrip().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
k = int(s[3])

ans = a - b

if(k%2==1):
  ans = -1 * ans

if(abs(ans) < 1000000000000000000):
  print(ans)
else:
  print("Unfair")

Buggy python submission (verdict: Time Limit Exceeded):
s = input().rstrip().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
k = int(s[3])

for i in range(k):
  n_a = b+c
  n_b = a+c
  n_c = a+b
  a = n_a
  b = n_b
  c = n_c

d = a - b
if(abs(d) < 100000000):
  print(a-b)
else:
  print("Unfair")

Fixed submission:
s = input().rstrip().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
k = int(s[3])

ans = a - b

if(k%2==1):
  ans = -1 * ans

if(abs(ans) < 1000000000000000000):
  print(ans)
else:
  print("Unfair")
Buggy python submission (verdict: Runtime Error):
x = int(input())

sosu = [2,3,5,7,11,13,17,19,23,29,31]

if(x==1):
  print(1)
else:
  ans = 1
  for i in range(len(sosu)):
    now = sosu[i]
    for j in range(1,11):
      now = now*sosu[i]
      if(now <= x and ans <= now):
        ans = now
      elif(now >= x):
        break

print(ans)

Fixed submission:
x = int(input())

num = list(range(2,32))

ans = 1
for i in range(len(num)):
  now = num[i]
  while now < x:
    now = now*num[i]
    if(now <= x and ans <= now):
      ans = now
print(ans)
Buggy python submission (verdict: Runtime Error):
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            0: 'A',
            1: 'B',
            2: 'C',
            3: 'D',
            4: 'E',
            5: 'F',
            6: 'G',
            7: 'H',
            8: 'I',
            9: 'J',
            10: 'K',
            11: 'L',
            12: 'M',
            13: 'N',
            14: 'O',
            15: 'P',
            16: 'Q',
            17: 'R',
            18: 'S',
            19: 'T',
            20: 'U',
            21: 'V',
            23: 'W',
            24: 'X',
            25: 'Y',
            26: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(n, s))


Fixed submission:
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            0: 'A',
            1: 'B',
            2: 'C',
            3: 'D',
            4: 'E',
            5: 'F',
            6: 'G',
            7: 'H',
            8: 'I',
            9: 'J',
            10: 'K',
            11: 'L',
            12: 'M',
            13: 'N',
            14: 'O',
            15: 'P',
            16: 'Q',
            17: 'R',
            18: 'S',
            19: 'T',
            20: 'U',
            21: 'V',
            22: 'W',
            23: 'X',
            24: 'Y',
            25: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(n, s))
Buggy python submission (verdict: Runtime Error):

n = int(input())

xlist=[]
sum=0
for i in range(n):
    xlist.append(input().split())
    if xlist[i][1] == "BTC":
        sum = sum + int(xlist[i][0])*380000
    else:
        sum = sum + int(xlist[i][0])

print(sum)


Fixed submission:

n = int(input())

xlist=[]
sum=0
for i in range(n):
    xlist.append(input().split())
    if xlist[i][1] == "BTC":
        sum = sum + float(xlist[i][0])*380000
    else:
        sum = sum + float(xlist[i][0])

print(sum)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i+num
num = num-max
print(num)
print(max)
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#1 <= T,X <= 100
T, X = map(float, input().split())
# 文字列の入力
#s = input()
t = T / X
# 出力
print(t)
#print("{} {}".format(a+b+c, s))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i
num = num-max
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#1 <= T,X <= 100
T, X = map(float, input().split())
# 文字列の入力
#s = input()
t = T / X
# 出力
print(t)
#print("{} {}".format(a+b+c, s))
Buggy python submission (verdict: Runtime Error):
#n = map(int,input().split())
mlist = list(map(int,input().split()))

i=0
while(True):
    i=i+1
    if mlist[i] % 2 == 0:
        mlist.append(mlist[i]/2)
    else:
        mlist.append(3*mlist[i]+1)
    for item in range(1,i):
        if mlist[0]==item:
            break
print(i)


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

i=0
while(True):
    if mlist[i] % 2 == 0:
        mlist.append(mlist[i]/2)
    else:
        mlist.append(3*mlist[i]+1)
    
    breakFlg = False
    for num in range(0,i):
        if int(mlist[num])==int(mlist[i]):
            if num!=i:
                breakFlg = True
    i=i+1
    if(breakFlg):
        break
print(i)

Buggy python submission (verdict: Runtime Error):
n = map(int,input().split())
#xlist = list(map(int,input().split()))

mlist=[n]
i=0
while(True):
    i=i+1
    if n % 2 == 0:
        mlist.append(n/2)
    else:
        mlist.append(3*n+1)
    for item in mlist:
        if mlist[0]==item:
            break

print(i)


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

i=0
while(True):
    if mlist[i] % 2 == 0:
        mlist.append(mlist[i]/2)
    else:
        mlist.append(3*mlist[i]+1)
    
    breakFlg = False
    for num in range(0,i):
        if int(mlist[num])==int(mlist[i]):
            if num!=i:
                breakFlg = True
    i=i+1
    if(breakFlg):
        break
print(i)
Buggy python submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[b-i-1]:
	j +=1
else:
	print(j)

Fixed submission:
a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)

Buggy python submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[(b-i-1)]
	j +=1
else
print(j)

Fixed submission:
a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)

Buggy python submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2
	if a[i] != a[b-i]
	j +=1
else
	print(j)
    


Fixed submission:
a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)
Buggy python submission (verdict: Runtime Error):
import itertools
import math

n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append(numpy.array([x, y]))

pattern_list = list(itertools.permutations(town_list, n))

a = int(math.factorial(n))

sum = 0
for j in range(a):
	for k in range(n-1):
		x1 = pattern_list[j][k][0]
		x2 = pattern_list[j][k+1][0]
		y1 = pattern_list[j][k][1]
		y2 = pattern_list[j][k+1][1]
		sum += math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

print(sum/a)


Fixed submission:
import numpy
import itertools
import math

n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append([x, y])

pattern_list = list(itertools.permutations(town_list, n))

a = int(math.factorial(n))

sum = 0
for j in range(a):
	for k in range(n-1):
		# sum += numpy.linalg.norm(pattern_list[j][k+1] - pattern_list[j][k])
		x1 = pattern_list[j][k][0]
		x2 = pattern_list[j][k+1][0]
		y1 = pattern_list[j][k][1]
		y2 = pattern_list[j][k+1][1]
		sum += math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

print(sum/a)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy
import itertools
import math
n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append(numpy.array([x, y]))

pattern_list = list(itertools.permutations(town_list, n))

sum = 0
for j in range(math.factorial(n)):
	for k in range(n-1):
		sum += numpy.linalg.norm(pattern_list[j][k+1] - pattern_list[j][k])

print(sum/math.factorial(n))

Fixed submission:
import numpy
import itertools
import math

n = int(input())
town_list = []
for i in range(n):
	x, y = map(int, input().split())
	town_list.append([x, y])

pattern_list = list(itertools.permutations(town_list, n))

a = int(math.factorial(n))

sum = 0
for j in range(a):
	for k in range(n-1):
		# sum += numpy.linalg.norm(pattern_list[j][k+1] - pattern_list[j][k])
		x1 = pattern_list[j][k][0]
		x2 = pattern_list[j][k+1][0]
		y1 = pattern_list[j][k][1]
		y2 = pattern_list[j][k+1][1]
		sum += math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

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

if a > 9 or b > 9:
	print("-1")
else:
	print(a*b)

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

if a > 9 or b > 9:
    print("-1")
else:
    print(a*b)
Buggy python submission (verdict: Runtime Error):
n = int(input())

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)

times = 10**12

for j in range(0, len(divisors), 2):
	time = (divisors[j] - 1) + (divisors[j+1] - 1)
	if time < times:
		times = time
print(times)


Fixed submission:
n = int(input())

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)

times = 10**12

for j in range(len(divisors)):
    x = divisors[j]
    y = n // x
    time = (x -1) + (y - 1)
    if time < times:
      times = time
print(times)
Buggy python submission (verdict: Time Limit Exceeded):
num_of_candidate, start_point, num_of_questions = map(int, input().split())
winner_list = [int(input()) for i in range(num_of_questions)]

if start_point > num_of_questions:
	for i in range(num_of_candidate):
		print("Yes")
	exit()


point_list = [start_point for i in range(num_of_candidate)]

for i in range(num_of_questions):
	winner_id = winner_list[i]
	for j in range(num_of_candidate):
		if j != winner_id - 1:
			point_list[j] -= 1

for i in range(num_of_candidate):
	if point_list[i] > 0:
		print("Yes")
	else:
		print("No")

Fixed submission:
import numpy as np

num_of_candidate, start_point, num_of_questions = map(int, input().split())
# winner_list = [int(input()) for i in range(num_of_questions)]
if start_point > num_of_questions:
	for i in range(num_of_candidate):
		print("Yes")
	exit()


start_points = np.array([start_point for i in range(num_of_candidate)])

got_points = np.array([0 for i in range(num_of_candidate)])
for i in range(num_of_questions):
	winner_id = int(input())
	got_points[winner_id - 1] += 1

lost_points = np.array([num_of_questions for i in range(num_of_candidate)]) - got_points

result_points = start_points - lost_points

for i in range(num_of_candidate):
	if result_points[i] > 0:
		print("Yes")
	else:
		print("No")

Buggy python submission (verdict: Time Limit Exceeded):
num_of_candidate, start_point, num_of_questions = map(int, input().split())
winner_list = [int(input()) for i in range(num_of_questions)]

point_list = [start_point for i in range(num_of_candidate)]

for i in range(num_of_questions):
	winner_id = winner_list[i]
	for j in range(num_of_candidate):
		if j != winner_id - 1:
			point_list[j] -= 1

for i in range(num_of_candidate):
	if point_list[i] > 0:
		print("Yes")
	else:
		print("No")

Fixed submission:
import numpy as np

num_of_candidate, start_point, num_of_questions = map(int, input().split())
# winner_list = [int(input()) for i in range(num_of_questions)]
if start_point > num_of_questions:
	for i in range(num_of_candidate):
		print("Yes")
	exit()


start_points = np.array([start_point for i in range(num_of_candidate)])

got_points = np.array([0 for i in range(num_of_candidate)])
for i in range(num_of_questions):
	winner_id = int(input())
	got_points[winner_id - 1] += 1

lost_points = np.array([num_of_questions for i in range(num_of_candidate)]) - got_points

result_points = start_points - lost_points

for i in range(num_of_candidate):
	if result_points[i] > 0:
		print("Yes")
	else:
		print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 1:
    print("No")
    exit()

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

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

if N % 2 == 1:
    print("No")
    exit()

if S[0:int(N/2)] == S[int(N/2):]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k=map(int,input().split())
print("Yay!" * (e-a > k) or ":(")

Fixed submission:
a=int(input())
input()
input()
input()
e=int(input())
k=int(input())
print("Yay!" * (e-a <= k) or ":(")
Buggy python submission (verdict: Runtime Error):
import numpy as np

n=int(input())
a=np.array(list(map(int,input().split())))
b=np.array(list(map(int,input().split())))

c=[]
for i in range(n):
    c.append(a[i] - b[i])

c.sort(reverse=True)
d=np.array(c)
z=np.sum(d < 0)

x=np.sum(d[ d < 0])
y=np.sum(d[ d > 0])

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

if x + y < 0:
    print("-1")
    exit()    

for i,num in enumerate(c)
    x += num
    if x >= 0:
        print(z+i+1)

Fixed submission:
import numpy as np

n=int(input())
a=np.array(list(map(int,input().split())))
b=np.array(list(map(int,input().split())))

c=[]
for i in range(n):
    c.append(a[i] - b[i])

c.sort(reverse=True)
d=np.array(c)
z=np.sum(d < 0)

x=np.sum(d[ d < 0])
y=np.sum(d[ d > 0])

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

if x + y < 0:
    print("-1")
    exit()    

for i,num in enumerate(c):
    x += num
    if x >= 0:
        print(z+i+1)
        exit()
Buggy python submission (verdict: Runtime Error):
n,h,w=map(int, input() for i in range(3))
 
print( (n - h + 1) * (n - w + 1))

Fixed submission:
n=int(input())
h=int(input())
w=int(input())

print( (n - h + 1) * (n - w + 1))
Buggy python submission (verdict: Runtime Error):
import math

n,p=map(int,input().split())

def C(N,P):
    if N == 1: return P
    b=int(math.log2(N))
    a=P**(1/b)

    res=1
    for i in range(2,int(a)+2):
        if i**N > P : break
        if P % i**N == 0 : res = i

    return res

print(C(n,p))

Fixed submission:
print(input().count("2"))

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

n,p=map(int,input().split())

def C(N,P):
    if N == 1: return P
    a=P
    N1=2
    while N >= N1:
        N1*=2
        a=math.sqrt(a)

    res=1
    for i in range(2,int(a)+2):
        if i**N > P : break
        if P % i**N == 0 : res = i

    return res

print(C(n,p))

Fixed submission:
print(input().count("2"))

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

N,P=map(int,input().split())
a=math.sqrt(P)
if N > 3 :
    b=math.sqrt(a)
    a=b

res=1
for i in range(1,int(a)+1):
    if P % i**N: continue
    res = i

print(res)

Fixed submission:
print(input().count("2"))

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

N,P=map(int,input().split())
a=math.sqrt(P)
if N > 3 : a=math.sqrt(a)

res=1
for i in range(1,int(a)+1):
    if P % i**N: continue
    res = i

print(res)

Fixed submission:
print(input().count("2"))
Buggy python submission (verdict: Runtime Error):
s = input()
week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
i = 0
for num,day in enumerate(weeK):
  if s == day:
    i = 7 - num
print(i)

Fixed submission:
s = input()
a = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
i = 0
for num,day in enumerate(a):
  if s == day:
    i = 7 - num

print(i)

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

if S == SUN:
    print('7')

if S == MON:
    print('6')
    
if S == TUE:
    print('5')
    
if S == WED:
    print('4')
    
if S == THU:
    print('3')
    
if S == FRI:
    print('2')
    
if S == SAT:
    print('1')

Fixed submission:
S = input()

if S == "SUN":
    print('7')

if S == "MON":
    print('6')
    
if S == "TUE":
    print('5')
    
if S == "WED":
    print('4')
    
if S == "THU":
    print('3')
    
if S == "FRI":
    print('2')
    
if S == "SAT":
    print('1')
Buggy python submission (verdict: Runtime Error):
print(input()**2)

Fixed submission:
s = int(input())

print(s*s)

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

print(int(x*x))

Fixed submission:
s = int(input())

print(s*s)

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

print(x*x)

Fixed submission:
s = int(input())

print(s*s)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

Fixed submission:
print('Yes' if (input() * 2).find(input()) != -1 else 'No')

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

Fixed submission:
print('Yes' if (input() * 2).find(input()) != -1 else 'No')

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u

Fixed submission:
print('Yes' if (input() * 2).find(input()) != -1 else 'No')
Buggy python submission (verdict: Runtime Error):
week_list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
rweek_list = reversed(week_list)

print(rweek_list.index(input()) + 1)

Fixed submission:
week_list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
week_list.reverse()

print(week_list.index(input()) + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if S[:N//2] == S[N//2:]:
 print('Yes')
else:
 print('No')

Fixed submission:
print(int(input()) ** 2)