Harryxun/stf_run huggingface dataset:
from fractions import gcd
    from functools import reduce
     
    mod = 10 ** 9 + 7
     
    def lcm_base(x, y):
        return (x * y) // gcd(x, y)
     
    def lcm(numbers):
        return reduce(lcm_base, numbers, 1)
     
    # print('input >>')
    N = int(input())
    A = list(map(int,(input().split())))
     
    lcmn = lcm(A)
     
    ans = 0
    for i in range(len(A)):
        ans += lcmn // A[i]
     
    # print('-----output-----')
    print(int(ans%mod))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
     
mod = 10 ** 9 + 7
     
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
     
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
     
    # print('input >>')
N = int(input())
A = list(map(int,(input().split())))
     
lcmn = lcm(A)
    
ans = 0
for i in range(len(A)):
    ans += lcmn // A[i]
     
    # print('-----output-----')
print(int(ans%mod))
n,k=map(int,input().split())
S=[] #[ネタ種類、おいしさ]のリスト
for i in range(n):
    S.append(list(map(int,input().split())))
S.sort(reverse=1,key=lambda x:x[1])

netano_min=min(S[j][0] for j in range(n))
for i in range(n):
    S[i][0]-=netano_min-1

neta=max(S[j][0] for j in range(n)) #ネタの種類数

F=[0 for i in range(neta+1)] #ネタi種のときの美味しさの和の最大値のリスト

ma=sum(S[i][1] for i in range(k))

neta_s=len(set([S[i][0] for i in range(k)]))

netano_min=min(S[j][0] for j in range(n))

F[neta_s]=ma

#print(S)
#print(F)
#print(ma)

netalist=[0 for i in range(n)] #i種類目のネタを使った個数
keseru=[] #ネタに重複がある寿司のリスト(消してもいい寿司)
for i in range(k):
    if netalist[S[i][0]]>=1 :
        keseru.append(S[i])
        
    netalist[S[i][0]]+=1

#print(keseru)
#print(netalist)

right=len(keseru)-1
left=k
i=neta_s+1
while len(keseru)>0 and i<=k and right>=0 and left<=n-1 :
    while left<=n-1 and netalist[S[left][0]]!=0 :
        left+=1
    if left==n-1 :
        break
    netalist[S[left][0]]+=1
    F[i]=F[i-1]+S[left][1]-keseru[right][1]
    right-=1
    left+=1
    i+=1

#print(F)
for j in range(neta_s,i+1-1) :
    F[j]+=j**2

print(max(F))


### FIXED CODE ###

n,k=map(int,input().split())
S=[] #[ネタ種類、おいしさ]のリスト
for i in range(n):
    S.append(list(map(int,input().split())))
S.sort(reverse=1,key=lambda x:x[1])

netano_min=min(S[j][0] for j in range(n))
for i in range(n):
    S[i][0]-=netano_min-1

neta=max(S[j][0] for j in range(n)) #ネタの種類数

F=[0 for i in range(neta+1)] #ネタi種のときの美味しさの和の最大値のリスト

ma=sum(S[i][1] for i in range(k))

neta_s=len(set([S[i][0] for i in range(k)]))

netano_min=min(S[j][0] for j in range(n))

F[neta_s]=ma

#print(S)
#print(F)
#print(ma)

netalist=[0 for i in range(n+1)] #i種類目のネタを使った個数
keseru=[] #ネタに重複がある寿司のリスト(消してもいい寿司)
for i in range(k):
    if netalist[S[i][0]]>=1 :
        keseru.append(S[i])
        
    netalist[S[i][0]]+=1

#print(keseru)
#print(netalist)

right=len(keseru)-1
left=k
i=neta_s+1
while len(keseru)>0 and i<=k and right>=0 and left<=n-1 :
    while left<=n-1 and netalist[S[left][0]]!=0 :
        left+=1
    if left==n :
        break
    netalist[S[left][0]]+=1
    F[i]=F[i-1]+S[left][1]-keseru[right][1]
    right-=1
    left+=1
    i+=1

#print(F)
for j in range(neta_s,i+1-1) :
    F[j]+=j**2

print(max(F))
def main():
 
    N, M = map(int, input().split())
    if N == 1:
        s, c = map(int, input().split())
        if s == 1: return c
        else: return -1
    
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])
 
    for v in range(pow(10, N-1), pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1
 
if __name__ == '__main__':
    print(main())

### FIXED CODE ###

def main():

    N, M = map(int, input().split())
    sc = []
    for _ in range(M):
        s, c = map(int, input().split())
        sc.append([s, c])

    start = pow(10, N-1)
    if N == 1: start = 0
    
    for v in range(start, pow(10, N)):
        t = str(v)
        if all(t[s-1] == str(c) for s, c in sc):
            return v
    return -1

if __name__ == '__main__':
    print(main())
x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=[]
a.sort()
b.sort()
c.sort()
for i in range(min(x,k)):
  for j in range(min(y,k)):
    if i*j>k:
      break
    for l in range(min(z,k)):
      if i*j*l>k:
        break
      else:
        ans.append(a[i],b[j],c[l])
ans.sort()
for i in range(k):
  print(ans[i])

### FIXED CODE ###

x,y,z,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=[]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
for i in range(min(x,k)):
  for j in range(min(y,k)):
    if i*j>k:
      break
    for l in range(min(z,k)):
      if i*j*l>k:
        break
      else:
        ans.append(a[i]+b[j]+c[l])
ans.sort(reverse=True)
for i in range(k):
  print(ans[i])
n=int(input())
a=list(map(int,input().split()))
mem=[0]*10

for i in a:
	mem[i-1]+=1

for i in mem:
	print(i)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
mem=[0]*n

for i in a:
	mem[i-1]+=1

for i in mem:
	print(i)
def actual(x):
    amount = 100

    count = 0

    while True:
        amount *= 1.01
        amount = math.floor(amount)

        count += 1

        if amount >= x:
            return count

x = int(input())
print(actual(x))

### FIXED CODE ###

import math


def actual(x):
    amount = 100

    count = 0

    while True:
        amount *= 1.01
        amount = math.floor(amount)

        count += 1

        if amount >= x:
            return count

x = int(input())
print(actual(x))
K = input()

S = int(input())

if len(K) <= S:
    print(K)

#[:●]で文字の数の始点をできる
else:
    print(K[:S] + "...")


### FIXED CODE ###

K = int(input())
S = input()
if len(str(S)) <= K:
    print(S)
else:
    print(S[:K]+'...')
for i in range(n-k+1):
    xtmp = x[i:i+k]
#     print(i, xtmp)

    if i==0:
        MIN = abs(xtmp[0])+2*abs(xtmp[-1])

    MIN = min(MIN, abs(xtmp[0]-xtmp[-1]) + abs(xtmp[0]))
    MIN = min(MIN, abs(xtmp[0]-xtmp[-1]) + abs(xtmp[-1]))

print(MIN)

### FIXED CODE ###

# -*- coding: utf-8 -*-

n, k = map(int, input().split())
X = list(map(int, input().split()))
ans = 10**10
for i in range(n-k+1):
    left = X[i]
    right = X[i+k-1]
    ans = min(ans, abs(left)+abs(left-right), abs(right)+abs(right-left))
print(ans)
S=input()
T=input()
k=0
for i in range(len(S))
	if S[i]==T[i]:
    	continue
  	else:
    	k+=1
print(k)

### FIXED CODE ###

S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)
N = int(input())
A = list(map(int, input().split()))

ans = 1
for a in ans:
  if ans >= 10**(18)/a:
	ans = -1
    break
  else:
    ans *= a

if 0 in A:
  print(0)
else:
  print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

ans = 1
for a in A:
  if ans > 10**(18)//a:
    ans = -1
    break
  else:
    ans *= a

if 0 in A:
  print(0)
else:
  print(ans)
def dfs(now):
    global m
    if now in l:
        m = now
        return None
    else:
        l.append(now)
        dfs(a[now - 1])
n, k = map(int, input().split())
a = list(map(int, input().split()))
m = float("inf")
l = []
cycle = float("inf")
ans = []
dfs(a[0])
for i in range(len(l)):
    if l[i] == m:
        ans = l[i:]
        cycle = len(ans)
if k % cycle == 0:
    print(ans[-1])
else:
    print(ans[(k - (len(l) - cycle)) % cycle - 1])

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
l = [0]
s = set()
s.add(0)
cur = a[0] - 1
while True:
    if cur in s:
        break
    else:
        s.add(cur)
        l.append(cur)
        cur = a[cur] - 1
i = l.index(cur)
if k <= i:
    print(l[k] + 1)
else:
    print(l[(k - i) % (len(l) - i) + i] + 1)
n = int(input())
s = str(input())
k = int(input())
 
a = []
 
for i in range(n):
  if s[i] == s[k]:
    a.append(s[k])
  else:
    a.append("*")
 
print(a)

### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
 
a = ""
 
for i in range(n):
  if s[i] == s[k-1]:
    a = a + s[k-1]
  else:
    a = a + "*" 
print(a)
import sys
def range_union(al,ah,bl,bh):
    cl = max(al,bl)
    ch = min(ah,bh)
    if cl > ch:
        return 0
    else:
        return ch-cl +1

N = int(sys.stdin.readline())
T = map(int,sys.stdin.readline().strip().split())
A = map(int,sys.stdin.readline().strip().split())

p = 1
for i in xrange(1,N-1):
    if T[i-1] < T[i]:
        Tl = T[i]
        Th = T[i]
    elif T[i-1] == T[i]:
        Tl = 1
        Th = T[i]
    else:
        p = 0
        break

    if A[i] > A[i+1]:
        Al = A[i]
        Ah = A[i]
    elif A[i+1] == A[i]:
        Al = 1
        Ah = A[i]
    else:
        p = 0
        break

    r = range_union(Tl,Th,Al,Ah)
    if not r:
        p = 0
        break
    else:
        p = p*r


print p % 1000000007 

### FIXED CODE ###

import sys 
s = sys.stdin.readline().strip()
c_find = False                                                                                                                                                                                                                        
f_find = False
for c in s:
    if c_find:
        if c == 'F':
            print 'Yes'
            exit(0)
    else:
        if c == 'C':
            c_find = True
print 'No'
S = input()
if S == ABC:
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

S = input()
if S == "ABC":
  print("ARC")

else:
  print("ABC")
N, K = map(int, input().split())
h = list(map(int, input().split()))
print(sum(1 if t >= K for t in h))

### FIXED CODE ###

N, K = map(int, input().split())
H = list(map(int, input().split()))
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)
k=int(input())
s=input()
l=len(s)
if(l<=k):
  print(s)
else:
  s=s[k:]
  print(s,end=" ",...)


### FIXED CODE ###

k=int(input())
s=input()
l=len(s)
if(l<=k):
  print(s)
else:
  s=s[:k]
  s=s+"..."
  print(s)
import sys
A="abcdefghijklmnopqrstuvwxyza"
def decode(s):
    x=""
    for c in s:
        if c in " .": x+=c
        else: x+=A[A.index(c)+1]
    return x

for s in sys.stdin.readlines():
    for i in range(26):
        if "the" in s or "that" in s or "this" in s:break
        s=decode(s)
print s[:-1]

### FIXED CODE ###

import sys,string
A="abcdefghijklmnopqrstuvwxyza"
tbl=string.maketrans(A[:-1],A[1:])
for s in sys.stdin:
    while not("the" in s or "that" in s or "this" in s):
        s=s.translate(tbl)
    print s[:-1]
n,t=map(int,input().spplit())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[n][1]<=t and ct[n][0]<=ans:
    ans=ct[n][0]
if ans<1001:
  print(ans)
else:
  print("TLE")

### FIXED CODE ###

n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=1001
for i in range(n):
  if ct[i][0]<=ans and ct[i][1]<=t:
    ans=ct[i][0]
if ans<1001:
  print(ans)
else:
  print("TLE")
from fractions import gcd

N, K = map(int, input().split())
A = [int(_) for _ in input().split()]
GCD = gcd(A[0], A[1])

for i in range(2, N):
    GCD = gcd(GCD, A[i])

if K <= max(A) and K % GCD == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

from fractions import gcd

N, K = map(int, input().split())
A = [int(_) for _ in input().split()]

if N == 1:
    print("POSSIBLE" if K == A[0] else "IMPOSSIBLE")
else:
    GCD = gcd(A[0], A[1])
    
    for i in range(2, N):
        GCD = gcd(GCD, A[i])
    
    if K <= max(A) and K % GCD == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
ans = 0
a = []
for _ in range(5):
    x = int(input())
    if x%10 == 0:
        ans += x
    else:
        ans += (x//10)*10
        a.append(x%10)

ans += (len(a)-1)*10
ans += min(a)

print(ans)

### FIXED CODE ###

ans = 0
a = []
for _ in range(5):
    x = int(input())
    if x%10 == 0:
        ans += x
    else:
        ans += (x//10)*10
        a.append(x%10)

ans += (len(a)-1)*10
if a != []:
    ans += min(a)
else:
    ans += 10

print(ans)
import heapq



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

one = V[::2]
two = V[1:][::2]

one_count={}
one_len=len(one)
values={}
for o in one:
    if o in values:
        values[o] += 1
    else:
        values[o] = 1

one_count[10**6]=one_len
for k,v in values.items():
    one_count[k] = one_len-v


    
two_len=len(two)
two_count={}
values={}

for t in two:
    if o in values:
        values[t] += 1
    else:
        values[t] = 1

two_count[10**6]=two_len
for k,v in values.items():
    two_count[k] = two_len-v




keys = list(set(V))
mins = 1000

for one_key, one_value in one_count.items():
    for two_key, two_value in two_count.items():
        if one_key != two_key:
            if one_value + two_value < mins:
                mins = one_value + two_value
print(mins)

### FIXED CODE ###

import heapq

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

one = V[::2]
two = V[1:][::2]

one,two

one_count={}
one_len=len(one)
for o in one:
    if o in one_count:
        one_count[o] += 1
    else:
        one_count[o] = 1

for k,v in one_count.items():
    one_count[k] = one_len-v
one_count[10**6]=one_len
temp = [[k,v] for k,v in one_count.items()]
one = heapq.nsmallest(3,temp, key=lambda x: x[1])


two_len=len(two)
two_count={}

for t in two:
    if t in two_count:
        two_count[t] += 1
    else:
        two_count[t] = 1

for k,v in two_count.items():
    two_count[k] = two_len-v
two_count[10**6]=two_len
temp = [[k,v] for k,v in two_count.items()]
two = heapq.nsmallest(3,temp, key=lambda x: x[1])

mins = 1000000

for [one_key, one_value] in one:
    for [two_key, two_value] in two:
        if one_key != two_key:
            if (one_value + two_value) < mins:
                mins = one_value + two_value
print(mins)
s=input()
k=int(input())
ans=1
for i in range(k+1):
    if s[i] != '1':
        ans=s[i]
        break
print(ans)

### FIXED CODE ###

s=input()
k=int(input())
ans=1
for i in range(k):
    if s[i] != '1':
        ans=s[i]
        break
print(ans)
import numpy
import sys
import itertools
input = sys.stdin.readline
inf = 200000000
n, m, r = map(int, input().split())
rs = list(map(int, input().split()))
n1 = n + 1
d = numpy.full((n1 * n1), inf)
for i in range(n1):
    d[i, i] = 0
for i in range(m):
    a, b, c = map(int, input().split())
    d[a * n1 + b] = d[b, + a] = c
for k, i, j in itertools.product(range(1, n1), repeat=3):
    d[i, j] = d[j, i] = min(
        d[i, j],
        d[i, k] + d[k, j])
s = inf
for q in itertools.permutations(range(r)):
    t = 0
    for i in range(r-1):
        t += d[rs[q[i]], rs[q[i+1]]]
    if s > t:
        s = t
print(s)


### FIXED CODE ###

from itertools import product, permutations


def warshall_floyd(d):
    # d        : nxn adjacent matrix
    for k, i, j in product(range(n), repeat=3):
        if d[i][j] > d[i][k] + d[k][j]:
            d[i][j] = d[i][k] + d[k][j]


INF = float("inf")
n, m, r = map(int, input().split())
r_list = list(map(lambda x: int(x) - 1, input().split()))
d = [[INF] * n for _ in range(n)]
for i in range(n):
    d[i][i] = 0
for i in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    d[a][b] = d[b][a] = c
warshall_floyd(d)

ans = float("inf")
for np in permutations(r_list):
    cand = sum([d[np[i]][np[i + 1]] for i in range(r - 1)])
    ans = min(ans, cand)

print(ans)
r=int(input())
print(r*2*math.pi)


### FIXED CODE ###

import math
r=int(input())
print(r*2*math.pi)
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)


### FIXED CODE ###

D,T,S = map(int,input().split())
if(D>T*S):
    print("No")
else:
    print("Yes")
n = int(input())
a = input().split()
pl = []
sb = []
for i in range(len(a)):
	pl.append(i+int(a[i])+1)
	if i - int(a[i]) > 1:
		sb.append(i-int(a[i])+1)


if len(sb) == 0:
	print('0')
else:

# spl = sorted(pl)
	isb = [int(i) for i in sb]
	ipl = [int(i) for i in pl]
	ssb = sorted(isb)
	# t = min(ssb)

	cnt = 0

	for i in ipl:
		for j in ssb:
			if i == j:
				cnt += 1
			if i < j:
				break

print(cnt)

### FIXED CODE ###

n = int(input())
a = input().split()
pl = []
sb = []
for i in range(len(a)):
	pl.append(i+int(a[i])+1)
	if i - int(a[i]) > 0:
		sb.append(i-int(a[i])+1)


if len(sb) == 0:
	print('0')
else:

# spl = sorted(pl)
	isb = [int(i) for i in sb]
	ipl = [int(i) for i in pl]
	ssb = sorted(isb)
	t = min(ssb)
	# tl = [0] * max(ipl)
	tl = [0] * 2000000	
	for i in ssb:
		if int(i)-1 < len(tl):
			tl[int(i)-1] += 1
	# print(pl)
	# print(sb)
	# print(tl)
	cnt = 0
	for i in pl:
		if int(i)-1 < len(tl):
			cnt += tl[int(i)-1]

	print(cnt)
class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y

def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2*a.x + b.x)/3, (2*a.y + b.y)/3)
  t = coordinates((a.x + 2*b.x)/3, (a.y + 2*b.y)/3)
  ux = (t.x - s.x)*cos(pi/3) - (t.y - s.y)*sin(pi/3) + s.x
  uy = (t.x - s.y)*sin(pi/3) + (t.y - s.y)*cos(pi/3) + s.y
 
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
 
n = input()
 
p1 = point(0.0, 0.0)
p2 = point(100.0, 0.0)
 
print p1.x, p1.y
koch(n, p1, p2)
print p2.x, p2.y

### FIXED CODE ###

import math

rad = math.radians(60)

class coordinates:
  def __init__(self, x, y):
    self.x = x
    self.y = y
 
def koch(n, a, b):
  if n == 0:
    return
  s = coordinates((2.0*a.x + b.x)/3.0, (2.0*a.y + b.y)/3.0)
  t = coordinates((a.x + 2.0*b.x)/3.0, (a.y + 2.0*b.y)/3.0)
  ux = (t.x - s.x)*math.cos(rad) - (t.y - s.y)*math.sin(rad) + s.x
  uy = (t.x - s.x)*math.sin(rad) + (t.y - s.y)*math.cos(rad) + s.y
  u = coordinates(ux, uy)
  
  koch(n-1, a, s)
  print  s.x, s.y
  koch(n-1, s, u)
  print  u.x, u.y
  koch(n-1, u, t)
  print  t.x, t.y
  koch(n-1, t, b)
  
n = input()
  
p1 = coordinates(0.0, 0.0)
p2 = coordinates(100.0, 0.0)
  
print p1.x, p1.y
koch(n, p1, p2)
print p2.x, p2.y
import sys
input = sys.stdin.readline

S,K=input().split()
K=int(K)
mod=998244353

LEN=len(S)

ONES=[]
Z=0
for s in S:
    if s=="0":
        Z+=1
    else:
        ONES.append(Z)

O=len(ONES)
Z=ONES[-1]

DP=[[0]*(O+1) for i in range(O+1)]
DP[0][0]=1

# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数

from collections import Counter
C=Counter(ONES)

for numb in range(Z,-1,-1):
    #print(DP)
    c=C[numb]

    NDP=[[0]*(O+1) for i in range(O+1)]

    for i in range(O+1):        
        for j in range(O+1):
            if DP[i][j]==0:
                continue
            for oku in range(c+j+1):
                if i+max(0,oku-c)<=O and 0<=c+j-oku<=O:
                    NDP[i+max(0,oku-c)][c+j-oku]+=DP[i][j]
    DP=NDP

ANS=0
for i in range(min(O,K)+1):
    ANS+=DP[i][0]

print(ANS%mod)


### FIXED CODE ###

import sys
input = sys.stdin.readline

S,K=input().split()
K=int(K)
mod=998244353

LEN=len(S)

ONES=[]
Z=0
for s in S:
    if s=="0":
        Z+=1
    else:
        ONES.append(Z)

if ONES==[]:
    print(1)
    sys.exit()

O=len(ONES)
Z=ONES[-1]

DP=[[0]*(O+1) for i in range(min(O,K)+1)]
DP[0][0]=1

# DP[i][j]で, i個石を動かし、j個石が残っているときの場合の数

from collections import Counter
C=Counter(ONES)

for numb in range(Z,-1,-1):
    #print(DP)
    c=C[numb]

    NDP=[[0]*(O+1) for i in range(min(O,K)+1)]

    for i in range(min(O,K)+1):        
        for j in range(O+1):
            if DP[i][j]==0:
                continue
            for oku in range(c+j+1):
                if i+max(0,oku-c)<=min(O,K) and 0<=c+j-oku<=O:
                    NDP[i+max(0,oku-c)][c+j-oku]+=DP[i][j]
    DP=NDP

ANS=0
for i in range(min(O,K)+1):
    ANS+=DP[i][0]

print(ANS%mod)
A = list(map(int, input().split()))
A = A.sorted()
print(A[0]+A[1])

### FIXED CODE ###

A = list(map(int, input().split()))
A = sorted(A)
print(A[0]+A[1])
while 1:
 x, y = map(int, raw_input().split())
 if x <= y:
    print "%d %d" % (x,y)
 elif y < x:
    print "%d %d" % (y,x)
 elif x == 0 and y == 0:
    break

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
X, Y, A, B, C = input().split()
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
R = list(map(int,input().split()))
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

ANS_list = P[:X]
ANS_list.extend(Q[:Y])
ANS_list.sort()
c = 0
for i in range(len(R)):
    if ANS_list[i] >= R[i]:
        break
    c+=1

if i!=0:
    ANS_list[:c] = R[:c]

print(sum(R[:c])+sum(ANS_list[c:]))

### FIXED CODE ###

X, Y, A, B, C = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
R = list(map(int,input().split()))
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

ANS_list = P[:X]
ANS_list.extend(Q[:Y])
ANS_list.sort()
c = 0
for i in range(len(R)):
  if ANS_list[i] >= R[i]:
    break
  c+=1

if i!=0:
  ANS_list[:c] = R[:c]
print(sum(R[:c])+sum(ANS_list[c:]))
a,b,k=map(int,input().split())
count=k
for i in range(100):
    if a%(i+1)==0 and b%(i+1)==0:
        count+=1
        if count==K:
            print(i+1)
            break

### FIXED CODE ###

a,b,k=map(int,input().split())
N=[]
for i in range(100):
    if a%(i+1)==0 and b%(i+1)==0:
        N.append(i+1)
N.sort(reverse=True)
print(N[k-1])
import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n = int(input())
    a = list(map(int,input().split()))
    ans = 0
    for i in range(0, n + 1, 2):
        if a[i] % 2 == 1:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n = int(input())
    a = list(map(int,input().split()))
    #ans = 0
    ans_list = [a[i] for i in range(n) if i % 2 == 0]
    ans = [ans_list[i] for i in range(len(ans_list)) if ans_list[i] % 2 == 1]
    #print(ans_list)
    #print(ans)
    print(len(ans))
    return 0

if __name__ == "__main__":
    main()
N = int(input())
a = list(map(int,input().split()))

count = 0
for i in range(N-1):
    if i+1 != a[i]:
        del a[i]
        count += 1

ans = True
for i in range(int(len(a))-1):
    if i+1!=a[i]:
        ans = False

if ans:
    print(count)
else:
    print(-1)


### FIXED CODE ###

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


count = 0
c = 1

for i in range(N):
    #print(a)
    if c != a[i]:
       # del a[i]
        count += 1
    else:
        c+=1

#print(c-1)
#print(count)
#print(len(a)-count)
if c-1==0 and count > 1:
    print(-1)
else:
    print(count)
def main():
    l = list(map(int, input().split()))
    x = [i for i in range(l[0],l[1])]
    y = [i for i in range(l[2],l[3])]
    all_pair = [x*y  for i in x for j in y]
    print(sorted(all_pair)[-1])
if __name__ == '__main__':
    main()

### FIXED CODE ###

import itertools
def main():
    l = list(map(int, input().split()))
    all_pair = []
    all_pair.append(l[0]*l[2])
    all_pair.append(l[0]*l[3])
    all_pair.append(l[1]*l[2])
    all_pair.append(l[1]*l[3])
    print(sorted(all_pair)[-1])
if __name__ == '__main__':
    main()