Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0

A_l = [i for i in A_l if i != 0]

for i in range(len(A_l)):
    for j in range(i+1,len(A_l)):
        a_sum = a_sum + (A_l[i] * A_l[j])
print(a_sum % (10**9+7))

Fixed submission:
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0

A_l = [i for i in A_l if i != 0]

sum_l = [0] * len(A_l)
for i in range(len(A_l)):
    if i == 0:
        sum_l[i] = A_l[i]
    else:
        sum_l[i] = sum_l[i-1] + A_l[i]

for i in range(len(A_l)-1):
    a_sum = a_sum + sum_l[i] * A_l[i+1]
print(a_sum % (10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0
for i in range(N):
    if A_l[i] == 0: continue
    for j in range(i+1,N):
        if A_l[j] == 0: continue
        a_sum = a_sum + (A_l[i] * A_l[j])
print(a_sum % (10**9+7))

Fixed submission:
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0

A_l = [i for i in A_l if i != 0]

sum_l = [0] * len(A_l)
for i in range(len(A_l)):
    if i == 0:
        sum_l[i] = A_l[i]
    else:
        sum_l[i] = sum_l[i-1] + A_l[i]

for i in range(len(A_l)-1):
    a_sum = a_sum + sum_l[i] * A_l[i+1]
print(a_sum % (10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0
for i in range(N):
    for j in range(i+1,N):
        a_sum = a_sum + (A_l[i] * A_l[j])
print(a_sum % (10**9+7))

Fixed submission:
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0

A_l = [i for i in A_l if i != 0]

sum_l = [0] * len(A_l)
for i in range(len(A_l)):
    if i == 0:
        sum_l[i] = A_l[i]
    else:
        sum_l[i] = sum_l[i-1] + A_l[i]

for i in range(len(A_l)-1):
    a_sum = a_sum + sum_l[i] * A_l[i+1]
print(a_sum % (10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0
for i in range(N):
    for j in range(i+1,N):
        a_sum = a_sum + (A_l[i] * A_l[j])
print(a_sum % (10**9+7))

Fixed submission:
N = int(input())
A_l = [int(i) for i in input().split()]
a_sum = 0

A_l = [i for i in A_l if i != 0]

sum_l = [0] * len(A_l)
for i in range(len(A_l)):
    if i == 0:
        sum_l[i] = A_l[i]
    else:
        sum_l[i] = sum_l[i-1] + A_l[i]

for i in range(len(A_l)-1):
    a_sum = a_sum + sum_l[i] * A_l[i+1]
print(a_sum % (10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 100001
A_sum = 0

for a in A:
    A_cnt[a]+=1

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_cnt[B] = 0

    for i, x in enumerate(A_cnt):
        if A_cnt[i] > 0:
            A_sum = A_sum + (i * A_cnt[i])
    print(A_sum)
    A_sum = 0

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 100001
A_sum = 0

# 各数値の数を数えておく
for a in A:
    A_cnt[a]+=1
    # ついでに現時点の総和も出しておく
    A_sum+=a

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_sum = A_sum + ((C-B) * A_cnt[B])
    A_cnt[B] = 0
    print(A_sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 100000
A_sum = 0

for a in A:
    A_cnt[a]+=1

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_cnt[B] = 0

    for i, x in enumerate(A_cnt):
        if A_cnt[i] > 0:
            A_sum = A_sum + (i * A_cnt[i])
    print(A_sum)
    A_sum = 0

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 100001
A_sum = 0

# 各数値の数を数えておく
for a in A:
    A_cnt[a]+=1
    # ついでに現時点の総和も出しておく
    A_sum+=a

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_sum = A_sum + ((C-B) * A_cnt[B])
    A_cnt[B] = 0
    print(A_sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 10000
A_sum = 0

for a in A:
    A_cnt[a]+=1

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_cnt[B] = 0

    for i, x in enumerate(A_cnt):
        if A_cnt[i] > 0:
            A_sum = A_sum + (i * A_cnt[i])
    print(A_sum)
    A_sum = 0

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
A_cnt = [0] * 100001
A_sum = 0

# 各数値の数を数えておく
for a in A:
    A_cnt[a]+=1
    # ついでに現時点の総和も出しておく
    A_sum+=a

for _ in range(Q):
    B, C = map(int, input().split())
    A_cnt[C] = A_cnt[C] + A_cnt[B]
    A_sum = A_sum + ((C-B) * A_cnt[B])
    A_cnt[B] = 0
    print(A_sum)
Buggy python submission (verdict: Runtime Error):
# A V
# B W
# T
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (V-W)*T >= B-A and (B-A) % (V-W) == 0 or (W-V)*T >= A-B and (A-B) % (W-V) == 0:
    print('YES')
else:
    print('NO')

Fixed submission:
# A V
# B W
# T
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (V-W)*T >= abs(B-A):
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
# A V
# B W
# T
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (V-W)*T >= B-A and (B-A) % (V-W) == 0:
    print('YES')
else:
    print('NO')

Fixed submission:
# A V
# B W
# T
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if (V-W)*T >= abs(B-A):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
answer = 1

for i in range(n):
    answer = a[i] * answer
    if a[i] == 0:
        print(answer)
        break
    elif answer > 1000000000000000000 and n == i+1:
        print(-1)
        break
    elif n == i+1:
        print(answer)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
answer = 1
zero_check = 0 in a

for i in range(n):
    answer = a[i] * answer
    if zero_check:
        print(0)
        break
    elif answer > 1000000000000000000:
        print(-1)
        break
else:
    print(answer)
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()

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

Fixed submission:
N = int(input())
if N % 10 in [2, 4, 5, 7, 9]:
	print('hon')
elif N % 10 in [0, 1, 6, 8]:
	print('pon')
elif N % 10 in [3]:
	print('bon')
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
sum = 0

if K >= A:
	sum = sum + A
	K = K - A
else:
	sum = K
	K = 0
if K >= B and K >= 1:
	K = K - B
else:
	K = 0
if K >= 1:
	sum = sum - K
	K = K - K

if sum >= 1:
	print(sum)
else:
	print(0)

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

if S == T[:-1]:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())
sum = 0

if K >= A:
	sum = A
	K = K - A
else:
	sum = K
	K = 0
if K >= B and K >= 1:
	K = K - B
else:
	K = 0
if K >= C and K >= 1:
	sum = sum - C
else:
	sum = sum - K

if sum >= 1:
	print(sum)
else:
	print(0)

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

if S == T[:-1]:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())

lst = [0] * N

for i in range(K):
	d = input()
    A = list(map(int, input().split()))
    for a in A:
    	lst[a-1] += 1

print(lst.count(0))        

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

lst = [0] * N

for i in range(K):
	d = input()
	A = list(map(int, input().split()))
	for a in A:
		lst[a-1] += 1

print(lst.count(0))
Buggy python submission (verdict: Runtime Error):
k = int(input())
a, b = map(int, input().split())

if b -a >= k and k < a
  print('OK')
else:
  print('NG')

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

for cnt in range(a, b + 1):
  if cnt % k == 0:
    print('OK')
    break
  elif cnt + 1 == b + 1:
    print('NG')
Buggy python submission (verdict: Runtime Error):
s, w = map(int, input().split())

if s < w
  print("unsafe")
else:
  print("safe")

Fixed submission:
s, w = map(int, input().split())

if s <= w:
  print("unsafe")
else:
  print("safe")

Buggy python submission (verdict: Runtime Error):
s, w = map(int, input().split())

if s < w
    print('unsafe')
else:
    print('safe')

Fixed submission:
s, w = map(int, input().split())

if s <= w:
  print("unsafe")
else:
  print("safe")

Buggy python submission (verdict: Runtime Error):
s, w = map(int, input().split())

if s < w
    out = 'unsafe'
else:
    out = 'safe'

print(out)

Fixed submission:
s, w = map(int, input().split())

if s <= w:
  print("unsafe")
else:
  print("safe")

Buggy python submission (verdict: Runtime Error):
s, w = map(int, input().split())

if s < w
    out = 'unsafe'
else
    out = 'safe'

print(out)

Fixed submission:
s, w = map(int, input().split())

if s <= w:
  print("unsafe")
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

while:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break

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

while True:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break

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

while:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break

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

while True:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break

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

while:
  c = c - b
  if c <= 0:
    print('Yes')
    break
  a = a - d
  if a <= 0:
    print('No')
    break

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

while True:
  c = c - b
  if c <= 0:
    print("Yes")
    break
  a = a - d
  if a <= 0:
    print("No")
    break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
counter = 0
s = "TEMP"
list = []

while n > 0:
  s = input()
  list.append(s)
  counter = 0
  for item in list:
    if item == s:
      counter = counter - 1
    counter = counter + 1
  counter += 1
  n = n - 1

print(counter)

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy python submission (verdict: Runtime Error):
n = int(input())
counter = 0
s = "TEMP"
list = []

while n > 0:
  s = input()
  list.append(s)
  counter = 0
  for item in list:
    if item == s
      counter = counter - 1
    counter = counter + 1
  n = n - 1

print(counter)

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy python submission (verdict: Runtime Error):
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy python submission (verdict: Runtime Error):
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy python submission (verdict: Runtime Error):
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy python submission (verdict: Runtime Error):
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)
Buggy python submission (verdict: Runtime Error):
# N：人数 M：種類
# K1：個 A1 A2 ...：好きな食べ物の数字
# K2 A1 A2
# 全員が好きな食べ物の種類数

N, M = map(int, input().split())
s = set(range(1, M+1))

for _ in range(N):
    k, *a = map(int, input().split())
    if len(s) == 0:
        s = a
    s&=set(a)
print(len(s))

Fixed submission:
# N：人数 M：種類
# K1：個 A1 A2 ...：好きな食べ物の数字
# K2 A1 A2
# 全員が好きな食べ物の種類数

N, M = map(int, input().split())
s = set(range(1, M+1))

for _ in range(N):
    k, *a = map(int, input().split())
    s&=set(a)
print(len(s))
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(int(sqrt(N))*int(sqrt(N)))

Fixed submission:
import math as chokudai
N = int(input())
print(int(chokudai.sqrt(N))*int(chokudai.sqrt(N)))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())

if A == B:
  print(C)
else if A == C:
  print(B)
else:
  print(A)

Fixed submission:
import sys as cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba
A,B,C = map(int,cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba.stdin.readline().split())

if A == B:
  print(C)
elif A == C:
  print(B)
else:
  print(A)

Buggy python submission (verdict: Runtime Error):
import sys as chokudairedcoderatcoderowner
A,B,C = map(int,input().split())

if A == B:
  print(C)
else if A == C:
  print(B)
else:
  print(A)

Fixed submission:
import sys as cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba
A,B,C = map(int,cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba.stdin.readline().split())

if A == B:
  print(C)
elif A == C:
  print(B)
else:
  print(A)

Buggy python submission (verdict: Runtime Error):
import sys as chokudairedcoderatcoderowner
A,B,C = map(int,chokudairedcoderatcoderowner.stdin.readline().split())

if A == B:
  print(C)
else if A == C:
  print(B)
else:
  print(A)

Fixed submission:
import sys as cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba
A,B,C = map(int,cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba.stdin.readline().split())

if A == B:
  print(C)
elif A == C:
  print(B)
else:
  print(A)

Buggy python submission (verdict: Runtime Error):
import sys as chokudairedcoderatcoderowner
A,B,C = map(int,chokudairedcoderatcoderowner.stdin.readline())

if A == B:
  print(C)
else if A == C:
  print(B)
else:
  print(A)

Fixed submission:
import sys as cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba
A,B,C = map(int,cghavcjhcbejwcbbsmbcjsdbcjdcadhbcjbdsjjcdjabjadbjsbcjdsbcsbcnsbcdnbcmbcmdabcdbjwhckfmknvskndleccdajbubcrjhebuoqbjhbjcdnaaayruegfubefruebhvy38bjhbvvbhcba.stdin.readline().split())

if A == B:
  print(C)
elif A == C:
  print(B)
else:
  print(A)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
    ans *= a

if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    exit()
ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        print(-1)
        break
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
from heapq import heappush, heappop

n, m = map(int, input().split())
edges = [[] for _ in range(n)]

for _ in range(n):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

INF = 10**18
ans = []


def dijkstra(N, G, s):
    dist = [INF] * n
    que = [(0, s)]
    dist[s] = 0
    while que:
        c, v = heappop(que)
        if dist[v] < c:
            continue
        for t in G[v]:
            if dist[v] + 1 < dist[t]:
                dist[t] = dist[v] + 1
                heappush(que, (dist[t], t))
    ans.append(dist[0])


for i in range(1, n):
    dijkstra(n, edges, i)

if 0 in ans:
    print('No')
else:
    print('Yes')
    print(*ans, sep='\n')


Fixed submission:
from collections import deque
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
edges = [[]for _ in range(n)]
for _ in range(m):
    a, b = map(lambda x: int(x)-1, input().split())
    edges[a].append(b)
    edges[b].append(a)

next_v = deque([0])
prev = [-1]*n
while next_v:
    v = next_v.popleft()
    for v2 in edges[v]:
        if prev[v2] != -1:
            continue
        prev[v2] = v+1
        next_v.append(v2)

print('Yes')
for x in prev[1:]:
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
ls = []
for i in range(101):
    ls.append(pow(i, 5))

a = 0
while True:
    b = pow(a, 5)-x
    if -b in ls:
        print(a, -ls.index(-b))
        break
    if b in ls:
        print(a, ls.index(b))
        break
    a += 1


Fixed submission:
x = int(input())

for a in range(200):
    for b in range(200):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()
        if pow(-a, 5) - pow(b, 5) == x:
            print(-a, b)
            exit()
        if pow(a, 5) - pow(-b, 5) == x:
            print(a, -b)
            exit()
        if pow(-a, 5) - pow(-b, 5) == x:
            print(-a, -b)
            exit()

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
ls = []
for i in range(101):
    ls.append(pow(i, 5))

a = 0
while True:
    b = pow(a, 5)-x
    if -b in ls:
        print(a, -ls.index(-b))
        break
    if b in ls:
        print(a, ls.index(b))
        break
    a += 1


Fixed submission:
x = int(input())

for a in range(200):
    for b in range(200):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()
        if pow(-a, 5) - pow(b, 5) == x:
            print(-a, b)
            exit()
        if pow(a, 5) - pow(-b, 5) == x:
            print(a, -b)
            exit()
        if pow(-a, 5) - pow(-b, 5) == x:
            print(-a, -b)
            exit()

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

a = 1
b = 0
while True:
    A = pow(a, 5)
    B = pow(b, 5)
    if A-B == x:
        print(a, b)
        break
    if A+B == x:
        print(a, -b)
        break
    a += 1
    b += 1


Fixed submission:
x = int(input())

for a in range(200):
    for b in range(200):
        if pow(a, 5) - pow(b, 5) == x:
            print(a, b)
            exit()
        if pow(-a, 5) - pow(b, 5) == x:
            print(-a, b)
            exit()
        if pow(a, 5) - pow(-b, 5) == x:
            print(a, -b)
            exit()
        if pow(-a, 5) - pow(-b, 5) == x:
            print(-a, -b)
            exit()
Buggy python submission (verdict: Runtime Error):
import math

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

ans = n*(n-1)//2 + m(m-1)//2
print(ans)


Fixed submission:
import math

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


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


if m >= 2:
    odd = combinations_count(m, 2)
elif m == 0 or m == 1:
    odd = 0

if n >= 2:
    even = combinations_count(n, 2)
elif n == 1:
    even = 1
elif n == 0:
    even = 0

answer = odd + even
if m == 1 and n == 1:
    answer = 0

print(answer)
Buggy python submission (verdict: Runtime Error):
import collections
import math


n = int(input())
aa = list(map(int, input().split()))
ls = [0] * (n-1)

c = collections.Counter(aa)

for i, j in c.items():
    ls[i] = j*(j-1)//2

total = sum(ls)

for i in aa:
    before = (c[i]-1)*(c[i]-2) // 2
    print(total - ls[i] + before)


Fixed submission:
import collections
import math


n = int(input())
aa = list(map(int, input().split()))
ls = [0] * (n+1)

c = collections.Counter(aa)

for i, j in c.items():
    ls[i] = j*(j-1)//2

total = sum(ls)

for i in aa:
    before = (c[i]-1)*(c[i]-2) // 2
    print(total - ls[i] + before)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
import math

n = int(input())
aa = list(map(int, input().split()))


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


c = collections.Counter(aa)

for a in aa:
    cc = c.copy()
    cc[a] -= 1
    ans = 0
    for i in cc.values():
        if i >= 2:
            ans += combinations_count(i, 2)
    print(ans)


Fixed submission:
import collections
import math


n = int(input())
aa = list(map(int, input().split()))
ls = [0] * (n+1)

c = collections.Counter(aa)

for i, j in c.items():
    ls[i] = j*(j-1)//2

total = sum(ls)

for i in aa:
    before = (c[i]-1)*(c[i]-2) // 2
    print(total - ls[i] + before)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if c-a-b < 0:
    print('No')
else:
    ans = 4*a*b < (c-a-b)**2

print('Yes' if ans else 'No')


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

if c-a-b < 0:
    print('No')
    exit()
else:
    ans = 4*a*b < (c-a-b)**2

print('Yes' if ans else 'No')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ss = []
cc = []
num = []

for _ in range(m):
    s, c = map(int, input().split())
    ss.append(s)
    cc.append(c)

for i in range(1000):
    if len(str(i)) != m:
        continue
    cnt = 0
    for s, c in zip(ss, cc):
        if str(i)[s-1] == str(c):
            cnt += 1
    if cnt == len(ss):
        num.append(i)

if num:
    print(num[0])
else:
    print(-1)


Fixed submission:
n, m = map(int, input().split())
ss = []
cc = []
num = []

for _ in range(m):
    s, c = map(int, input().split())
    ss.append(s)
    cc.append(c)

for i in range(1000):
    if len(str(i)) != n:
        continue
    cnt = 0
    for s, c in zip(ss, cc):
        if str(i)[s-1] == str(c):
            cnt += 1
    if cnt == len(ss):
        num.append(i)

if num:
    print(num[0])
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ss = []
cc = []
num = []

for _ in range(m):
    s, c = map(int, input().split())
    ss.append(s)
    cc.append(c)

for i in range(1, 1000):
    if len(str(i)) != m:
        continue
    cnt = 0
    for s, c in zip(ss, cc):
        if str(i)[s-1] == str(c):
            cnt += 1
    if cnt == len(ss):
        num.append(i)

if num:
    print(min(num))
else:
    print(-1)


Fixed submission:
n, m = map(int, input().split())
ss = []
cc = []
num = []

for _ in range(m):
    s, c = map(int, input().split())
    ss.append(s)
    cc.append(c)

for i in range(1000):
    if len(str(i)) != n:
        continue
    cnt = 0
    for s, c in zip(ss, cc):
        if str(i)[s-1] == str(c):
            cnt += 1
    if cnt == len(ss):
        num.append(i)

if num:
    print(num[0])
else:
    print(-1)