Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)


def DFS(point,left,right,cnt):
    global ans
    if point<=k:
        if cnt>ans:
            ans=cnt

    if left<n:
        if point+A[left]<=k:DFS(point+A[left],left+1,right,cnt+1)
    if right<m:
        if point+B[right]<=k:DFS(point+B[right],left,right+1,cnt+1)


n,m,k=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
ans=0
DFS(0,0,0,0)
print(ans)

### FIXED CODE ###

n,m,k=map(int,input().split())
A=[0]+list(map(int,input().split()))
B=[0]+list(map(int,input().split()))

for i in range(1,n+1):
    A[i]=A[i-1]+A[i]
for i in range(1,m+1):
    B[i]=B[i-1]+B[i]

ans,j=0,m
for i in range(n+1):
    if A[i]>k:break
    while B[j]>k-A[i]:
        j -=1
    ans=max(ans,i+j)
print(ans)
### BUGGY CODE ###

import sys
s = input()
q = int(input())
t = []

def F(f,ans,c):
  if f == '1':
     return c + ans
  if f == '2':
    return ans + c

def R(r):
  if r == '1':return '2'
  if r == '2':return '1'

ans = s
r = '1'
for n in range(q):
  t = input().split()
  if t[0] == '1':
    r = R(r)
  else:
    if r =='2':
      t[1] = R(t[1])
    ans = F(t[1],ans,t[2])

    
if r == '1': 
   print(ans)
else:
  a = ''
  for n in ans:
    a = n + a
  print(a)

### FIXED CODE ###


s = input()
q = int(input())
t = []
 
def F(f,fr,ba,c):
  if f == '1':
     return c + fr, ba
  if f == '2':
    return fr,ba + c

def R(r):
  if r == '1':return '2'
  if r == '2':return '1'

ans = s
fr = ''
ba = ''
r = '1'
for n in range(q):
  t = input().split()
  if t[0] == '1':
    r = R(r)
  else:
    if r =='2':
      t[1] = R(t[1])
    fr, ba = F(t[1],fr,ba,t[2])
 
    
if r == '1': 
   print(fr + ans + ba)
else:
  print(ba[::-1] + ans[::-1]+ fr[::-1])
### BUGGY CODE ###

def d_ki():
    import sys
    sys.setrecursionlimit(10**6)
    N, Q = [int(i) for i in input().split()]
    Edges = [[int(i) for i in input().split()] for j in range(N - 1)]
    Queries = [[int(i) for i in input().split()] for j in range(Q)]

    tree = [[] for _ in range(N)]
    for a, b in Edges:
        tree[a - 1].append(b - 1)
        tree[b - 1].append(a - 1)

    ans = [0] * N
    # 1次元配列だったら累積和を取ればいいのだが、木なので
    # dfsをしなければならない
    for p, x in Queries:
        ans[p - 1] += x

    def dfs(current, parent=-1):
        for child in tree[current]:
            if child == parent:
                continue
            ans[child] += ans[current]
            dfs(child, current)
    dfs(0)
    return ' '.join(map(str, ans))

print(d_ki())

### FIXED CODE ###

def d_ki():
    import sys
    input = sys.stdin.readline
    N, Q = [int(i) for i in input().split()]

    tree = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = [int(i) for i in input().split()]
        tree[a - 1].append(b - 1)
        tree[b - 1].append(a - 1)

    ans = [0] * N
    for _ in range(Q):
        p, x = [int(i) for i in input().split()]
        ans[p - 1] += x

    # 1次元配列だったら単純に累積和を取ればいいのだが、木なので
    # DFSをしなければならない
    q = [0]
    is_visited = [False] * N
    while q:
        current = q.pop()
        is_visited[current] = True
        for child in tree[current]:
            if is_visited[child]:
                continue
            ans[child] += ans[current]
            q.append(child)
    return ' '.join(map(str, ans))

print(d_ki())
### BUGGY CODE ###

h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * (w + 1))
t = [[-1] * w for _ in range(h + 1)]
tstart = [-1] * (w + 1)
for i in range(h + 1):
  ystart = -1
  for j in range(w + 1):
    if s[i][j] == '#':
      if ystart != -1:
        for k in range(ystart, j):
          t[i][k] += j - ystart
        ystart = -1
      if tstart[j] != -1:
        for k in range(tstart[j], i):
          t[k][j] += i - tstart[j]
        tstart[j] = -1
    else:
      if ystart == -1:
        ystart = j
      if tstart[j] == -1:
        tstart[j] = i
print(max(map(max, t)))


### FIXED CODE ###

h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  if s[i][0] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, w + 1):
    if s[i][j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j
result = 0
for i in range(h):
  for j in range(w):
    t = yoko[i][j] + tate[i][j] - 1
    if t > result:
      result = t

print(result)
### BUGGY CODE ###

# 写経
# https://atcoder.jp/contests/m-solutions2020/submissions/15454214

import sys
import numpy as np
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
XYP = np.array(read().split(), np.int64)

def resolve():
	X, Y, P = XYP[::3], XYP[1::3], XYP[2::3]
	N = len(X)
	X_cost = np.empty((1 << N,N), np.int64)
	X_cost[0] = np.abs(X) * P
	for n in range(N):
		B = 1 << n
		X_cost[B:2 * B] = np.minimum(X_cost[:B], np.abs((X-X[n]) * P))
	#print(X_cost)
	Y_cost = np.empty((1 << N,N), np.int64)
	Y_cost[0] = np.abs(Y) * P
	for n in range(N):
		B = 1 << n
		Y_cost[B:2 * B] = np.minimum(Y_cost[:B], np.abs((Y-Y[n]) * P))
	#print(Y_cost)
	popcount = np.zeros(1 << N, np.int64)
	for n in range(N):
		popcount[1 << n:1 << n + 1] = popcount[:1 << n] + 1
	#print(popcount)

	INF = 10**18
	ans = np.full(N + 1, INF, np.int64)
	for s in range(1 << N):
		size = popcount[s]
		t = s
		#print("s" + str(s))
		#print("size" + str(size))
		while True:
			u = s ^ t
			#print("u" + str(u))
			#print("t" + str(t))
			cost = (np.minimum(X_cost[t], Y_cost[u])).sum()
			ans[size] = min(ans[size], cost)
			if t == 0:
				break
			t = (t - 1) & s
	for Ans in ans:
		print(Ans)
    
resolve()

### FIXED CODE ###

# 写経
# https://atcoder.jp/contests/m-solutions2020/submissions/15454214

import sys
import numpy as np
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def resolve(XYP):
	X, Y, P = XYP[::3], XYP[1::3], XYP[2::3]
	N = len(X)
	X_cost = np.empty((1 << N,N), np.int64)
	X_cost[0] = np.abs(X) * P
	for n in range(N):
		B = 1 << n
		X_cost[B:2 * B] = np.minimum(X_cost[:B], np.abs((X-X[n]) * P))
	#print(X_cost)
	Y_cost = np.empty((1 << N,N), np.int64)
	Y_cost[0] = np.abs(Y) * P
	for n in range(N):
		B = 1 << n
		Y_cost[B:2 * B] = np.minimum(Y_cost[:B], np.abs((Y-Y[n]) * P))
	#print(Y_cost)
	popcount = np.zeros(1 << N, np.int64)
	for n in range(N):
		popcount[1 << n:1 << n + 1] = popcount[:1 << n] + 1
	#print(popcount)

	INF = 10**18
	ans = np.full(N + 1, INF, np.int64)
	for s in range(1 << N):
		size = popcount[s]
		t = s
		#print("s" + str(s))
		#print("size" + str(size))
		while True:
			u = s ^ t
			#print("u" + str(u))
			#print("t" + str(t))
			cost = (np.minimum(X_cost[t], Y_cost[u])).sum()
			ans[size] = min(ans[size], cost)
			if t == 0:
				break
			t = (t - 1) & s
	return ans 

if sys.argv[-1] == 'ONLINE_JUDGE':
	import numba
	from numba.pycc import CC
	i8 = numba.int64
	cc = CC('my_module')
 
	def cc_export(f, signature):
		cc.export(f.__name__, signature)(f)
		return numba.njit(f)
 
	resolve = cc_export(resolve, (i8[:], ))
	cc.compile()
 
from my_module import resolve

N = int(readline())
XYP = np.array(read().split(), np.int64)

ans = resolve(XYP)
print('\n'.join(map(str, ans.tolist())))
### BUGGY CODE ###

from collections import defaultdict

N = int(input())
S = input()
D = defaultdict(int)

res = 0

for i in range(N):
    for j in range(i + 1, N + 1):
        s = S[i:j]
        if s in D and D[s] + (j - i) <= i:
            res = max(res, j - i)
        else:
            D[s] = i

print(res)

### FIXED CODE ###

n = int(input())
s = input()

ans = 0
right = 1

for left in range(n):
    while s[left:right] in s[right:]:
        ans = max(ans,right-left)
        right += 1
        
print(ans)
### BUGGY CODE ###

N=int(input())
list=list(map(int,input().split()))
A=1
for i in range(N):
	for j in range(i+1):
		if list[i]>list[j]:
			break
		else:
			if j==i-1:
				A+=1
print(A)

### FIXED CODE ###

N=int(input())
list=list(map(int,input().split()))
A=1
i=0
j=0
for x in range(N):
  if list[i]<list[j]: 
      A=A+1
      j=i
  i=i+1
print(A)
### BUGGY CODE ###

A, B, K = map(int, input().split())

j = 0
k = B-K

for i in range(A, B+1):
    if K > j or k < i:
        print(i)
    j += 1


### FIXED CODE ###

A, B, K = map(int, input().split())

for i in range(A, min(B+1, A+K)):
    print(i)
for i in range(max(B+1-K, A+K), B+1):
    print(i)
### BUGGY CODE ###

import math
import itertools
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()))
b = list(itertools.combinations(a,2))
ans = [0,(0,0)]
#print(b)
for i in range(len(b)):
    tmpans = combinations_count(max(b[i][0], b[i][1]),min(b[i][0], b[i][1]))
    if tmpans >= ans[0]:
        ans = [tmpans,(max(b[i][0], b[i][1]),min(b[i][0], b[i][1]))]
        
print(ans[1][0],ans[1][1])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a.sort()
dis = [abs(a[-1]/2 - a[i]) for i in range(n-1)]
r = a[dis.index(min(dis))]
print(a[-1],r)
### BUGGY CODE ###

from functools import reduce
n = int(input())
a = list(map(int, input().split()))
m = 10**18

res = reduce(lambda x,y: x*y, a)
if res > m:
    print(-1)
else:
    print(res)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
m = 10**18
if 0 in a:
    print(0)
    exit()
res = 1
for i in a:
    res *= i
    if res > m:
        print(-1)
        exit()

print(res)
### BUGGY CODE ###

import collections
from itertools import combinations
import sys
input = sys.stdin.readline

N = int(input())
s = [''.join(sorted(list(input()))) for _ in range(N)]
#for i in range(N):
#    s.append(''.join(sorted(list(input()))))
c = collections.Counter(s)

cnt = 0
for i in c.values():
    if i > 1:
        cnt += len(tuple(combinations(range(i), 2)))
print(cnt)

### FIXED CODE ###

import collections
from itertools import combinations
import sys
input = sys.stdin.readline

N = int(input())
s = [''.join(sorted(list(input()))) for _ in range(N)]
c = collections.Counter(s)

cnt = 0
for i in c.values():
    if i > 1:
        cnt += i*(i-1)//2
print(cnt)
### BUGGY CODE ###

def resolve():
    import math
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        count = math.floor(n/i)
        last = int(math.floor(n/i) * i)
        ans += (i+last)*count//2
    print(ans)


resolve()

### FIXED CODE ###

def resolve():
    import math
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        count = math.floor(n/i)
        last = int(math.floor(n/i) * i)
        ans += (i+last)*count//2
    print(ans)

resolve()
### BUGGY CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())
a = 0
for i in range (N):
	a = a + (i+1)*len(make_divisors(i+1))
print(a)

### FIXED CODE ###

N = int(input())
a = 0
for i in range (N):
	x= N//(i+1)
	a += x*(x+1)*(i+1)

a = a/2
	
print(int(a))
### BUGGY CODE ###

#encoding: utf-8

n, q = map(int, input().split())
s = input()


for i in range(q):
    l, r = list(map(int, input().split()))

    print(s[l - 1:r].count("AC"))


### FIXED CODE ###

#encoding: utf-8

n, q = map(int, input().split())
s = input()

t = [0] * (n + 1)

for i in range(n):
    t[i + 1] = t[i] + (1 if s[i: i + 2] == "AC" else 0)

for i in range(q):
    l, r = list(map(int, input().split()))

    print(t[r - 1] - t[l - 1])
### BUGGY CODE ###

from collections import Counter
n, m = map(int, input().split())
A = list(map(int, input().split()))
cA = Counter(A)
mA = min(cA)
for i in range(m):
    b, c = map(int, input().split())
    while b>0 and mA<c:
        if b>cA[mA]:
            cA[c] += cA[mA]; b -= cA[mA]
            del cA[mA]
            mA = min(min(cA), c)
        else:
            cA[mA] -= b
            cA[c] += b
            b = 0
ans = 0
for key, val in cA.items():
    ans += key*val
print(ans)

### FIXED CODE ###

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

B = [[] for _ in range(m)]
for i in range(m):
    B[i] = list(map(int, input().split()))
B.sort(key=lambda x: -x[1])

_A = []
cnt = 0
for i in range(m):
    _A.extend([B[i][1]]*B[i][0])
    cnt += B[i][0]
    if cnt > n:
        break
A += _A
A.sort(reverse=True)
print(sum(A[:n]))
### BUGGY CODE ###

N = int(input())
alist = list(map(int,input().split()))
p = 1
for i in range(N-1):
    for j in range(i+1,N):
        if alist[i] == alist[j]:
            p = p*0
            print('NO')
            break
if p == 1:
    print('YES')

### FIXED CODE ###

N = int(input())
alist = list(map(int,input().split()))
alist.sort()
p = 1
for i in range(N-1):
    if alist[i] == alist[i+1]:
        p = p*0
        print('NO')
        break
if p == 1:
    print('YES')
### BUGGY CODE ###

n = int(input())
A = tuple(map(int, input().split()))
fact_counts = dict()
def fact(n):
    if n%2 == 0:
        fact_counts.setdefault(2, 0)
        fact_counts[2] += 1
        while n%2 == 0:
            n //= 2

    for f in range(3, int(n**0.5)+1, 2):
        if n%f == 0:
            fact_counts.setdefault(f, 0)
            fact_counts[f] += 1
            while n%f == 0:
                n //= f

    if n > 1:
        fact_counts.setdefault(n, 0)
        fact_counts[n] += 1

for a in A:
    fact(a)

pairwise = True
for c in fact_counts.values():
    if c > 1:
        pairwise = False
        break

if pairwise:
    print('pairwise coprime')
else:
    if max(fact_counts.values()) == n:
        print('not coprime')
    else:
        print('setwise coprime')


### FIXED CODE ###

N = int(input())
A = tuple(map(int, input().split()))
maxa = max(A)
min_facts = [0] * (maxa+1)
def p(n):
    """ """
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n+1):
        if not is_prime[i]:
            continue
        min_facts[i] = i
        
        for j in range(i*2, n+1, i):
            is_prime[j] = False
            if min_facts[j] == 0:
                min_facts[j] = i
p(maxa)
fact_counts = dict()
for a in A:
    while min_facts[a] > 0:
        f = min_facts[a]
        fact_counts.setdefault(f, 0)
        fact_counts[f] += 1
        while a%f == 0:
            a //= f

pairwise = True
for c in fact_counts.values():
    if c > 1:
        pairwise = False
        break

if pairwise:
    print('pairwise coprime')
else:
    if max(fact_counts.values()) == N:
        print('not coprime')
    else:
        print('setwise coprime')
### BUGGY CODE ###

import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
    ans %= 10**9+7
 
print(ans)

### FIXED CODE ###

import fractions as math
from functools import reduce
 
 
N = int(input())
A=list(map(int, input().split()))
 
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
num = lcm_list(A)
 
ans = 0
 
for i in range(N):
    ans += (num // A[i])
 
print(ans%(10**9+7))
### BUGGY CODE ###

# # coding=UTF-8
# from collections import deque
# from operator import itemgetter
# from bisect import bisect_left, bisect
# import itertools
# import sys
# import math
# import numpy as np
# import time

n, x, y = map(int, input().split())
tree = [[0] * n for i in range(n)]

for i in range(1, n):
    for j in range(i+1, n+1):
        # if i <= x and j >= y:
        #     tree[i - 1][j - 1] = j-i-(y - x - 1)
        # elif i <= x and j < y:
        #     tree[i - 1][j - 1] = x - i + min(y - j + 1, j - x)
        # elif i > x and j >= y:
        #     tree[i - 1][j - 1] = j - y + min(i-x+1, y-i)
        # else:
        #     tree[i - 1][j - 1] = j-i
        tree[i - 1][j - 1] = min(j-i, abs(x-i) +
                                    1+abs(j-y), abs(y-i)+1+abs(j-x))

for k in range(1, n):
    ans = 0
    for i in range(n):
        ans += tree[i].count(k)
    print(ans)


### FIXED CODE ###

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import copy
import numpy as np
import sys
INF = float('inf')
mod = 10**9+7


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

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n, x, y = LI()
    d = [0]*n
    for i in range(1, n):
        for j in range(i + 1, n + 1):
            d[min(j - i, abs(x - i) + 1 + abs(j - y),
                  abs(y - i) + 1 + abs(j - x)) - 1] += 1
    for k in range(n-1):
        print(d[k])


if __name__ == "__main__":
    main()
### BUGGY CODE ###

n,K = map(int, input().split(' '))
s = input()
ls0 = [0]
ls1 = [0]
if s[0] == "0":
    ls1[0] = -1
for i in range(n):
    if s[i] == "0":
        ls0[-1] += 1
        if ls1[-1] != 0:
            ls1.append(0)
    if s[i] == "1":
        ls1[-1] += 1
        if ls0[-1] != 0:
            ls0.append(0)
if s[0] == "0":
    ls1[0] = 0
if ls0[-1] == 0:
    del ls0[-1]
ansmax = 0
if K>=len(ls0):
    ansmax = len(s)
else:
    for i in range(len(ls0)-K+1):
        ansmax = max(ansmax, sum(ls0[i:i+K])+sum(ls1[i:i+K+1]))
print(ansmax)

### FIXED CODE ###

n,K = map(int, input().split(' '))
s = input()
ls0 = [0]
ls1 = [0]
if s[0] == "0":
    ls1[0] = -1
for i in range(n):
    if s[i] == "0":
        ls0[-1] += 1
        if ls1[-1] != 0:
            ls1.append(0)
    if s[i] == "1":
        ls1[-1] += 1
        if ls0[-1] != 0:
            ls0.append(0)
if s[0] == "0":
    ls1[0] = 0
if ls0[-1] == 0:
    del ls0[-1]
ans = []
ansmax = 0
if K>=len(ls0):
    ansmax = len(s)
else:
    ans.append(sum(ls0[0:K])+sum(ls1[0:K+1]))
    for i in range(1,len(ls0)-K+1):
        ans.append(ans[-1]+ls0[i+K-1]+ls1[i+K]-ls0[i-1]-ls1[i-1])
    else:
        ans.sort()
        ansmax = ans[-1]
print(ansmax)
### BUGGY CODE ###

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

for i in range(n):
    print(a.count(i+1))


### FIXED CODE ###

import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

for i in range(n):
    print(a[i+1])
### BUGGY CODE ###

# ABC142D - Disjoint Set of Common Divisors
def gcd(x: int, y: int) -> int:
    while y:
        x, y = y, x % y
    return x


def prime_factors(x: int) -> list:
    if x % 2:
        max_prime, factors = 0, []
    else:
        max_prime, factors = 2, [2]
        while x % 2 == 0:
            x //= 2
    for i in range(3, x + 1, 2):
        if x % i == 0:
            max_prime = i
            factors.append(i)
            while x % i == 0:
                x //= i
    if x > 2:  # when x is prime greater than 2
        factors.append(x)
    return factors


def main():
    # compute the number of prime factors of gcd(A, B)
    A, B = map(int, input().split())
    g = gcd(A, B)
    ans = len(prime_factors(g)) + 1
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC142D - Disjoint Set of Common Divisors
def divisors(n: int) -> set:
    div = set()
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            div.add(i), div.add(n // i)
    return div


def main():
    A, B = map(int, input().split())
    divs = sorted(divisors(A) & divisors(B))
    divs.pop(0)
    groups = set()
    for i in divs:
        if all(i % x for x in groups):
            groups.add(i)
    ans = len(groups) + 1
    print(ans)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import sys
import collections

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
c = collections.Counter(a)
ans = [0 for i in range(sorted(c.keys())[-1]+1)]

for i in c.keys():
    tmp = 0
    for j in c.keys():
        if i == j:
            tmp += (c[j]-1)*(c[j]-2)//2
        else:
            tmp += c[j]*(c[j]-1)//2
    ans[i] = tmp

for i in a:
    print(ans[i])


### FIXED CODE ###

import sys
import collections

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
c = collections.Counter(a)
ans = [0 for i in range(sorted(c.keys())[-1]+1)]

for i in c.keys():
    ans[i] = c[i]*(c[i]-1)//2

sans = sum(ans)
for i in a:
    print(sans - ans[i] + ans[i]*(c[i]-2)//c[i])
### BUGGY CODE ###

n = int(input())
s = []
ans = 0
for i in range(n):
  a = input()
  count = 0 if a in s else 1
  s.append(a)
  ans += count
print(ans)

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
print(len(set(s)))
### BUGGY CODE ###

n = int(input())
li = list(map(int, input().split()))
li = sorted(li)
count = 1
if not (1 in li and 0 in li):
    count = 0
else:
    for i in range(2,max(li) + 1):
        a = li.count(i-1)
        b = li.count(i)
        count *= a ** b
print(count % 998244353)


### FIXED CODE ###

n = int(input())
li = list(map(int, input().split()))
box = [0 for x in range(max(li)+1)]
for i in li:
    box[i] += 1
count = 1

if len(box) > 2:
    for i in range(1, len(box)-1):
        count *= box[i] ** box[i+1]
        count %= 998244353
else:
    count = 1
    
if box[0] != 1 or li[0] != 0:
    count = 0

print(count % 998244353)
### BUGGY CODE ###

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

count = 0
for i in range(n):
    li = p[:i+1]
    li.sort()
    if li[0] == p[i]:
        count += 1
        
print(count)

### FIXED CODE ###

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

m = p[0]
count = 1
for i in range(1,n):
    if m >= p[i]:
        m = p[i]
        count += 1
        
print(count)
### BUGGY CODE ###

N = int(input())
A = []
mx=0
for i in range(N):
    A.append(int(input()))


if A.count(max(A)) > 1:
    for i in range(N):
        print(max(A))
else:
    for i in range(N):
        if A[i] != max(A):
            print(max(A))
        else:
            print(sorted(A)[-2])

### FIXED CODE ###

N = int(input())
A = []

mx=0
for i in range(N):
    A.append(int(input()))

M = max(A)
    
if A.count(max(A)) > 1:
    for i in range(N):
        print(M)
else:
    for i in range(N):
        if A[i] != M:
            print(M)
        else:
            print(sorted(A)[-2])
### BUGGY CODE ###

n = int(input())

l = list(map(int,input().split()))

ans = 1
for i in range(n):
    ans *= l[i]
    if ans > 10**18:
      ans = -1
      break
    elif 0 in l:
      ans = 0
      break
    else:
      continue

print(ans)


### FIXED CODE ###

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

l.sort(reverse = True)
ans = l[-1]
for i in range(n-1):
    ans *= l[i]
    if ans > 10**18:
      ans = -1
      break
    elif ans == 0:
      ans = 0
      break

print(ans)