Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
while a>0 and c>0:
  c=c-b
  a=a-d
if a=0:
  print("No")
else:
  print("Yes")
  

Fixed submission:
a,b,c,d = map(int,input().split())
counter_1=0
counter_2=0
while c>0:
  c=c-b
  counter_1=counter_1+1 #counter_1は高橋の攻撃回数
while a>0:
  a=a-d
  counter_2=counter_2+1 #counter_2は青木の攻撃回数
if counter_2>=counter_1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
    num=a.count(i)
    print(num)

Fixed submission:
import collections
n=int(input())
a=list(map(int,input().split()))
c=collections.Counter(a)
for i in range(1,n+1):
    print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import math

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

n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
com=0
for i in range(1,n+1):
    if(c[i]<=1):
        continue
    com+=combinations_count(c[i],2)
for k in range(1,n+1):
    ans=com
    if(c[a[k-1]]>=2):
        ans-=combinations_count(c[a[k-1]],2)
        if((c[a[k-1]]-1)>=2):
            ans+=combinations_count(c[a[k-1]]-1,2)
    print(ans)

Fixed submission:
from collections import Counter
import math

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

n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
com=0
for i in range(1,n+1):
    if(c[i]<=1):
        continue
    com+=combinations_count(c[i],2)
for k in range(1,n+1):
    ans=com
    ans-=c[a[k-1]]-1
    print(ans)

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

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

n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
com=0
for i in range(1,n+1):
    if(c[i]<=1):
        continue
    com+=combinations_count(c[i],2)
for k in range(1,n+1):
    ans=com
    if(c[a[k-1]]>=2):
        ans-=combinations_count(c[a[k-1]],2)
        if((c[a[k-1]]-1)>=2):
            ans+=combinations_count(c[a[k-1]]-1,2)
    print(ans)

Fixed submission:
from collections import Counter
import math

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

n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
com=0
for i in range(1,n+1):
    if(c[i]<=1):
        continue
    com+=combinations_count(c[i],2)
for k in range(1,n+1):
    ans=com
    ans-=c[a[k-1]]-1
    print(ans)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
if(H==1 or R==1):
  print(1)
else:
  if((H*W)%2==0):
    print(int(H*W/2))
  else:
    print(int(H*W/2)+1)

Fixed submission:
H,W=map(int,input().split())
if(H==1 or W==1):
  print(1)
else:
  if((H*W)%2==0):
    print(int(H*W/2))
  else:
    print(int(H*W/2)+1)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s=query[2]+s
        else:
            s=s+query[2]
if cnt%2==1:
    s=s[::-1]
print(s)

Fixed submission:
from collections import deque
s=deque(input())
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s.appendleft(query[2])
        else:
            s.append(query[2])
if cnt%2==1:
    s=reversed(s)
print("".join(s))

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s=query[2]+s
        else:
            s=s+query[2]
if cnt%2==1:
    s=s[::-1]
print(s)

Fixed submission:
from collections import deque
s=deque(input())
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s.appendleft(query[2])
        else:
            s.append(query[2])
if cnt%2==1:
    s=reversed(s)
print("".join(s))

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        s=s[::-1]
    else:
        if query[1]=="1":
            s=query[2]+s
        else:
            s=s+query[2]
print(s)

Fixed submission:
from collections import deque
s=deque(input())
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s.appendleft(query[2])
        else:
            s.append(query[2])
if cnt%2==1:
    s=reversed(s)
print("".join(s))

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
q=int(input())
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        s=s[::-1]
    else:
        if query[1]=="1":
            s=query[2]+s
        else:
            s=s+query[2]
print(s)

Fixed submission:
from collections import deque
s=deque(input())
q=int(input())
cnt=0
for i in range(q):
    query=list(input().split())
    if query[0]=="1":
        cnt+=1
    else:
        if (cnt+int(query[1]))%2==1:
            s.appendleft(query[2])
        else:
            s.append(query[2])
if cnt%2==1:
    s=reversed(s)
print("".join(s))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(len(a)):
    if a[i]<=min(a[:i+1]):
        cnt+=1
print(cnt)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
List=list(map(int,input().split()))
cnt=0
for i in range(len(List)):
    if List[i]<=min(List[:i+1]):
        cnt+=1
print(cnt)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = tuple(map(int,input().split()))
counter=0
for i in range(N):
  if min(List[0:i+1])==List[i]:
    counter=counter+1
      
print(counter)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = tuple(map(int,input().split()))
counter=0
for i in range(N):
  if min(List[0:i+1])==List[i]:
    counter=counter+1
      
print(counter)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = list(map(int,input().split()))
counter=0
for i in range(N):
  if min(List[0:i+1])==List[i]:
    counter=counter+1
      
print(counter)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
List = list(map(int,input().split()))
counter=0
for i in range(N):
  if min(List[0:i+1])==List[i]:
    counter=counter+1
      
print(counter)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
cnt=0
min_num=p[0]
for i in p:
    if i<=min_num:
        min_num=i
        cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())
for i in range(1,K+1):
  if(A>0):
    A=A-1
  elif(B>0):
    B=B-1
  elif(A==0 and B==0):
    A=A
    B=B
print(A,B)

Fixed submission:
A,B,K = map(int,(input().split()))
rem = A - K
if(A+B < K):
    print('0 0')
elif(rem < 0):
    print('0' + ' ' + str(B+rem))
else:
    print(str(rem) + ' ' + str(B))
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A==1 and B==2):
	x=3
elif(A==2 and B==3):
	x=1
elif(A==3 and B==1):
	x=2
print(x)


Fixed submission:
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==1 and B==3):
  answer=2
elif(A==2 and B==3):
  answer=1
elif(A==2 and B==1):
  answer=3
elif(A==3 and B==1):
  answer=2
elif(A==3 and B==2):
  answer=1
print(answer)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==2 and B==3):
  answer=1
elif(A==3 and B==1):
  answer=2
print(answer)


Fixed submission:
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==1 and B==3):
  answer=2
elif(A==2 and B==3):
  answer=1
elif(A==2 and B==1):
  answer=3
elif(A==3 and B==1):
  answer=2
elif(A==3 and B==2):
  answer=1
print(answer)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer==3
elif(A==2 and B==3):
  answer==1
elif(A==3 and B==1):
  answer==2
print(answer)


Fixed submission:
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==1 and B==3):
  answer=2
elif(A==2 and B==3):
  answer=1
elif(A==2 and B==1):
  answer=3
elif(A==3 and B==1):
  answer=2
elif(A==3 and B==2):
  answer=1
print(answer)

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==2 and B==3):
  answer=1
elif(A==3 and B==1):
  answer=2
print(answer)


Fixed submission:
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==1 and B==3):
  answer=2
elif(A==2 and B==3):
  answer=1
elif(A==2 and B==1):
  answer=3
elif(A==3 and B==1):
  answer=2
elif(A==3 and B==2):
  answer=1
print(answer)

Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
if(A==1 and B==2):
  answer=3
elif(A==2 and B==3):
  answer=1
elif(A==3 and B==1):
  answer=2
print(answer)

Fixed submission:
A=int(input())
B=int(input())
if(A==1 and B==2):
  answer=3
elif(A==1 and B==3):
  answer=2
elif(A==2 and B==3):
  answer=1
elif(A==2 and B==1):
  answer=3
elif(A==3 and B==1):
  answer=2
elif(A==3 and B==2):
  answer=1
print(answer)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
T=input()
x = [S[i:i+1] for i in range(len(S))]
y = [T[i:i+1] for i in range(len(T))]

Fixed submission:
N = int(input())
S, T = map(str, input().split())
 
s = ''
 
for i in range(N):
    s = s + S[i] + T[i]
 
print(s)
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy python submission (verdict: Runtime Error):
import fractions
A, B = map(int, input().split())
x = A * B // gcd(A, B)
print(x)


Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy python submission (verdict: Runtime Error):
import fractions
A=int(input())
B=int(input())
x = A * B // gcd(A, B)
print(x)


Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy python submission (verdict: Runtime Error):
import math
A=int(input())
B=int(input())
x = A * B // gcd(A, B)
print(x)


Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))

Buggy python submission (verdict: Runtime Error):
import math
A=int(input())
B=int(input())
x = A * B / gcd(A, B)
print(x)

Fixed submission:
import fractions
a, b = map(int, input().split())
print(a * b // fractions.gcd(a, b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
height=h[0]
l=[]
cnt=0
for i in range(1,n):
    if h[i]<=height:
        cnt+=1
    else:
        cnt=0
    height=h[i]
    l.append(cnt)
print(max(l))

Fixed submission:
n=int(input())
if n==1:
    print(0)
    exit()
h=list(map(int,input().split()))
height=h[0]
l=[]
cnt=0
for i in range(1,n):
    if h[i]<=height:
        cnt+=1
    else:
        cnt=0
    height=h[i]
    l.append(cnt)
print(max(l))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n,m=map(int,input().split())
c=Counter()
for i in range(m):
    l,r=list(map(int,input().split()))
    idcard=list(range(l,r+1))
    c+=Counter(idcard)
cnt=0
for i in range(1,n+1):
    if c[i]==m:
        cnt+=1
print(cnt)

Fixed submission:
n,m=map(int,input().split())
l_max=0
r_min=10**5+1
for i in range(m):
    l,r=map(int,input().split())
    l_max=max(l_max,l)
    r_min=min(r_min,r)
print(max(0,r_min-l_max+1))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
gate=[]
cnt=0
for i in range(m):
    lr=list(map(int,input().split()))
    gate.append(lr)
for j in range(1,n+1):
    if all(j in range(gate[i][0],gate[i][1]+1) for i in range(len(gate))):
        cnt+=1
print(cnt)

Fixed submission:
n,m=map(int,input().split())
l_max=0
r_min=10**5+1
for i in range(m):
    l,r=map(int,input().split())
    l_max=max(l_max,l)
    r_min=min(r_min,r)
print(max(0,r_min-l_max+1))
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
List=[a,b,c,d,e]
for i in range(len(List)):
    for j in range(i+1,len(List)+1):
        if List[j]-List[i]>k:
            print(":(")
            exit()
print("Yay!")

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
List=[a,b,c,d,e]
for i in range(len(List)):
    for j in range(i+1,len(List)):
        if List[j]-List[i]>k:
            print(":(")
            exit()
print("Yay!")
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if (2*k>b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1),1):
    ans.append(i)
for i in range(b,max(a,b-k),-1):
    ans.append(i)
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if ((b-a+1)%2==0 and 2*k>=b-a) or ((b-a+1)%2==1 and 2*k>=b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1),1):
    ans.append(i)
for i in range(b,max(a,b-k),-1):
    ans.append(i)
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if ((b-a+1)%2==0 and k>=b-a) or ((b-a+1)%2==1 and k>=b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1),1):
    ans.append(i)
for i in range(b,max(a,b-k),-1):
    ans.append(i)
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if b-a+1<=k:
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1),1):
    ans.append(i)
for i in range(b,max(a,b-k),-1):
    ans.append(i)
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
List = list(map(int, input().split()))
ans = 0
while all(i%2 == 0 for i in List):
  a = [i/2 for i in List]
  ans += 1
print(ans)

Fixed submission:
n=int(input())
List=list(map(int,input().split()))
ans=0
while(1):
    for i in range(n):
        if List[i]%2!=0:
            print(ans)
            exit()
    for i in range(n):
        List[i]//=2
    ans+=1

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
List = list(map(int, input().split()))
ans = 0
while all(i%2 == 0 for i in List):
  a = [i/2 for i in List]
  ans += 1
print(ans)

Fixed submission:
n=int(input())
List=list(map(int,input().split()))
ans=0
while(1):
    for i in range(n):
        if List[i]%2!=0:
            print(ans)
            exit()
    for i in range(n):
        List[i]//=2
    ans+=1

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
List = list(map(int, input().split()))
ans = 0
while all(i%2 == 0 for i in List):
  a = [i/2 for i in List]
  ans += 1
print(ans)

Fixed submission:
n=int(input())
List=list(map(int,input().split()))
ans=0
while(1):
    for i in range(n):
        if List[i]%2!=0:
            print(ans)
            exit()
    for i in range(n):
        List[i]//=2
    ans+=1
Buggy python submission (verdict: Runtime Error):
import math
import sys

sys.setrecursionlimit(10**6)

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

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

LCM=lcm(t[0],t[1])
for i in range(2,n):
    LCM=lcm(LCM,t[i])

print(LCM)

Fixed submission:
import math

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

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

LCM=t[0]
for i in range(1,n):
    LCM=lcm(LCM,t[i])

print(LCM)

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

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

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

LCM=lcm(t[0],t[1])
for i in range(2,n):
    LCM=lcm(LCM,t[i])

print(LCM)

Fixed submission:
import math

def lcm(x,y):
    return (x*y)//math.gcd(x,y)

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

LCM=t[0]
for i in range(1,n):
    LCM=lcm(LCM,t[i])

print(LCM)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
            if s-(i+j) in range(k+1):
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
            if s-(i+j) in range(k+1):
                ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        for k in range(k+1):
            if i+j+k==s:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
            if s-(i+j) in range(k+1):
                ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
        for k in range(k+1):
            if i+j+k==s:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0
for i in range(k+1):
    for j in range(k+1):
            if s-(i+j) in range(k+1):
                ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if a[i]==j+1 and a[j]==i+1:
            cnt+=1
print(cnt)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(len(a)):
    if a[a[i]-1]==i+1:
            cnt+=1
print(cnt//2)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
a = [int(i) for i in input().split()]

chk = [0]*(10**6+1)

for i in range(n):
    #if chk[a[i]] == 1 and a[i] >= 2:
    #    print("not coprime")
    #    exit()
    chk[a[i]] += 1

flag = True

for i in range(2,10**6+1):
    #tmp = i
    kake = 1
    num = 0
    #print(i)
    while i * kake <= 10**6:
        if chk[i*kake] >= 2:
            flag = False
            break
        #print(i)
        if chk[i*kake] == 1:
            if num == 1:
                flag = False
                break
            num = 1
            #break
        kake += 1
gcd_num = math.gcd(a[0],a[1])
        
for i in range(n-2):
    gcd_num = math.gcd(gcd_num,a[i+2])
    
if flag == True:
    print("pairwise coprime")
elif gcd_num == 1:
    print("setwise coprime")
else:
    print("not coprime")


Fixed submission:
import math
n = int(input())
a = [int(i) for i in input().split()]

chk = [0]*(10**6+1)

for i in range(n):
    #if chk[a[i]] == 1 and a[i] >= 2:
    #    print("not coprime")
    #    exit()
    chk[a[i]] += 1

flag = True

for i in range(2,10**6+1):
    #tmp = i
    kake = 1
    num = 0
    #print(i)
    while i * kake <= 10**6:
        if chk[i*kake] >= 2:
            flag = False
            break
        #print(i)
        if chk[i*kake] == 1:
            if num == 1:
                flag = False
                break
            num = 1
            #break
        kake += 1
gcd_num = math.gcd(a[0],a[1])
        
for i in range(n-2):
    gcd_num = math.gcd(gcd_num,a[i+2])
    
if flag == True:
    print("pairwise coprime")
elif gcd_num == 1:
    print("setwise coprime")
else:
    print("not coprime")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ai = [int(i) for i in input().split()]

ans = 1

for i in range(n):
    ans *= ai[i]
    
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
ai = [int(i) for i in input().split()]

ans = 1

ai.sort(reverse=True)

if ai[n-1] == 0:
    print(0)
    exit()

for i in range(n):
    ans *= ai[i]
    if ans > 10**18:
        print(-1)
        exit()
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ai = [int(i) for i in input().split()]

li = [0]*(10**6+1)

for i in range(1,n):
    if ai[i] >= 2*10**5:
        continue
    li[ai[i]-i+5*10**5] += 1

ans = 0

for i in range(1,n):
    #print(i)
    ans += li[-ai[i-1]-(i-1)+5*10**5]
    if i == n:
        #print(i,i,i)
        break
    if ai[i] < 2*10**5:
        li[ai[i]-i+5*10**5] -= 1
        
print(ans)

Fixed submission:
n = int(input())
ai = [int(i) for i in input().split()]

li = [0]*(10**6+1)

for i in range(1,n):
    if ai[i] >= 2*10**5:
        continue
    li[ai[i]-i+5*10**5] += 1

ans = 0

for i in range(1,n):
    if ai[i-1] >= 2*10**5:
        continue
    #print(i)
    ans += li[-ai[i-1]-(i-1)+5*10**5]
    if i == n:
        #print(i,i,i)
        break
    if ai[i] < 2*10**5:
        li[ai[i]-i+5*10**5] -= 1
        
print(ans)