Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Your code here!
import fractions
N=int(input())
t=int(input())
for i in range(N-1):
    t1=int(input())
    g=fractions.gcd(t,t1)
    ans=g*t*t1
    t=g
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!
import fractions
from functools import reduce
N=int(input())
L=[]
for i in range(N):
    L.append(int(input()))
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
    
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
print(lcm_list(L))
N-int(input())
s=list(map(int, input().split()))
s.sort()
ans=0
for i in range(N-1):
    if i==0:
        ans=s[0]
    else:
        ans=((ans+s[i])/2)
print(ans)

### FIXED CODE ###

N=int(input())
s=list(map(int, input().split()))
s.sort()
ans=s[0]
for i in range(N-1):
    ans=((ans+s[i+1])/2)
print(ans)
x=input()
ans=len(x)
r=len(x)
if "ST" in x:
    x.remove("ST")
    ans-=2
while r!=len(x):
    r=len(x)
    if "ST" in x:
        x.remove("ST")
        ans-=2
print(ans)

### FIXED CODE ###

x=input()
l=[x[0]]
for i in range(1,len(x)):
    if l!=[]:
        if l[-1]=="S":
            h=1
        else:
            h=0
    l.append(x[i])
    if len(l)!=1:
        if l[-1]=="T":
            if h==1:
                l.pop(-1)
                l.pop(-1)
                if l!=[]:
                    h=(0 if l[-1]=="T" else 1)
                else:
                    h=0
            else:
                h=0
        else:
            h=0
print(len(l))
N = int(input())

xyhs = []
for n in range(N):
	x, y, h = map(int, input().split())
	xyhs.append((x,y,h))

if n == 1:
	x, y, h = xyhs[0]
	print(cx, cy, H)
	exit()
			
for cx in range(101):
	for cy in range(101):
		x, y, h = xyhs[0]
		H = h + abs(x - cx) + abs(y - cy)

		for xyh in xyhs[1:]:
			x, y, h = xyh
			if H != h + abs(x - cx) + abs(y - cy):
				break
		else:
			if H < 1:
				H = 1
			print(cx, cy, H)
			exit()


### FIXED CODE ###

N = int(input())

xyhs = []
for n in range(N):
	x, y, h = map(int, input().split())
	xyhs.append((x,y,h))

xyhs.sort(key=lambda x:x[2], reverse = True)

for cx in range(101):
	for cy in range(101):
		x, y, h = xyhs[0]
		H = h + abs(x - cx) + abs(y - cy)
				
		for xyh in xyhs[1:]:
			x, y, h = xyh

			if h == 0:
				if H > abs(x - cx) + abs(y - cy):
					break
			else:
				if H != h + abs(x - cx) + abs(y - cy):
					break
		else:
			if H < 1:
				H = 1
			print(cx, cy, H)
			exit()
a = int(input())
b = int(input())

ans = 0
outlet = 1

while b > outlet:
    ans = ans + 1
    outlet = outlet + (a-1)
print(ans)

### FIXED CODE ###

a, b = map(int, input().split())

ans = 0
outlet = 1

while b > outlet:
    ans = ans + 1
    outlet = outlet + (a-1)
print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = map(str, input().split())

print(f'{t}{s}')


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

s, t = map(str, input().split())

print('{}{}'.format(t, s))
#coding:utf-8
n, d = map(int, input().split())

flag = [0] * n
people = 0

for i in range(0,d):
    flag[i] = 1


for i in range(d, n):
    if flag[i] == 0:
        people += 1
        #print(i)
        for j in range(i, i+d+1):
            if j > n-d:
                flag = [1] * n
                break 
            else:
                flag[j] = 1
        #print(flag)


#print(flag)
print(people)


### FIXED CODE ###

#coding:utf-8
n, d = map(int, input().split())

#監視員は2D+1本の木を監視する
#最小の監視員はN/2D+1 の切り上げ
print(-(-n // (2*d + 1)))
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)==str(i)[::-1]:
        count+=1　　#count++はダメ
       
print(count)


### FIXED CODE ###

a,b=map(int,input().split())
cnt = 0
for i in range(a, b+1):
	if str(i) == str(i)[::-1]:
		cnt += 1
 
print(cnt)
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

s=input()
x,y=map(int,input().split())
lst=[[],[]]
cnt=0
tmp=0
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    else:
        if cnt==0:
            x-=tmp
        else:
            if tmp!=0:
                lst[cnt%2].append(tmp)
        tmp=0
        cnt+=1
if tmp!=0:
    lst[cnt%2].append(tmp)
dpx=[[0]*16001 for i in range(len(lst[0])+1)]
dpy=[[0]*16001 for i in range(len(lst[1])+1)]
dpx[0][8000]=1
dpy[0][8000]=1

for i in range(len(lst[0])):
    for j in range(16001):
        if dpx[i][j]!=0:
            dpx[i+1][j+lst[0][i]]+=1
            dpx[i+1][j-lst[0][i]]+=1

for i in range(len(lst[1])):
    for j in range(16001):
        if dpy[i][j]!=0:
            dpy[i+1][j+lst[1][i]]+=1
            dpy[i+1][j-lst[1][i]]+=1

if dpx[len(lst[0])][8000+x]!=0 and dpy[len(lst[0])][8000+y]!=0:
    print("Yes")
else:
    print("No")
# print(x,lst)

### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

s=input()
x,y=map(int,input().split())
lst=[[],[]]
cnt=0
tmp=0
for i in range(len(s)):
    if s[i]=="F":
        tmp+=1
    else:
        if cnt==0:
            x-=tmp
        else:
            if tmp!=0:
                lst[cnt%2].append(tmp)
        tmp=0
        cnt+=1
if cnt==0:
    x-=tmp
elif tmp!=0:
    lst[cnt%2].append(tmp)

sumx=sum(lst[0])
sumy=sum(lst[1])
# print(x,sumx)
if sumx<x or x<-sumx:
    print("No")
    exit()
if sumy<y or y<-sumy:
    print("No")
    exit()
dpx=[[0]*(sumx*2+1) for i in range(len(lst[0])+1)]
dpy=[[0]*(sumy*2+1) for i in range(len(lst[1])+1)]
dpx[0][sumx]=1
dpy[0][sumy]=1

for i in range(len(lst[0])):
    for j in range(sumx*2+1):
        if dpx[i][j]!=0:
            dpx[i+1][j+lst[0][i]]+=1
            dpx[i+1][j-lst[0][i]]+=1

for i in range(len(lst[1])):
    for j in range(sumy*2+1):
        if dpy[i][j]!=0:
            dpy[i+1][j+lst[1][i]]+=1
            dpy[i+1][j-lst[1][i]]+=1

# print(dpx)
# print(dpy)
if dpx[len(lst[0])][sumx+x]!=0 and dpy[len(lst[1])][sumy+y]!=0:
    print("Yes")
else:
    print("No")
# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        sys.setrecursionlimit(10 ** 4 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = defaultdict(list)
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            adj[a].append(b)
            adj[b].append(a)
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print((dfs(0, k - 1) * k) % MOD)




solver = EVirusTree2()
input = sys.stdin.readline

solver.solve()


### FIXED CODE ###

# @author 

import sys

class EVirusTree2:

    def solve(self):
        from collections import defaultdict
        import sys
        sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7
        n, k  = [int(_) for _ in input().split()]
        adj = defaultdict(list)
        for i in range(n - 1):
            a, b = [int(_) for _ in input().split()]
            a -= 1
            b -= 1
            adj[a].append(b)
            adj[b].append(a)
        done = [0] * n
        def dfs(s, rem):
            done[s] = 1
            if rem < 0:
                return 0
            res = 1
            for x in adj[s]:
                if done[x]:
                    continue
                if rem <= 0:
                    return 0
                res = (res * rem) % MOD
                res = (res * dfs(x, k - 2)) % MOD
                rem -= 1
                if res == 0:
                    return 0
            return res

        print((dfs(0, k - 1) * k) % MOD)




solver = EVirusTree2()
input = sys.stdin.readline

solver.solve()
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import time
import math
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
N=int(input())
A=list(map(int,input().split()))
A=[[A[i],i] for i in range(N)]
A.sort()
c=0
for i in range(N//2):
    a1,i1=A.pop()
    a2,i2=A.pop()
    b=(N-1-i)
    c+=max(a1*round(abs(i-i1))+a2*round(abs(b-i2)),a1*round(abs(b-i1))+a2*round(abs(i-i2)))
if N%2:
    a1,i1=A.pop()
    b=(N-1)//2
    c+=ai*round(abs(b-i1))
print(c)


### FIXED CODE ###

from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import time
import math
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
N=int(input())
A=list(map(int,input().split()))
A=[[A[i],i] for i in range(N)]
A.sort(reverse=True)
dp=[[0 for i in range(N+1)] for _ in range(N+1)]
for n in range(N):
    a,p=A[n]
    for x in range(1,n+2):
        y=n+1-x
        dp[x][y]=max(dp[x][y],dp[x-1][y]+round(abs(x-1 - p))*a)
    for y in range(1,n+2):
        x=n+1-y
        dp[x][y]=max(dp[x][y],dp[x][y-1]+round(abs(N-y - p))*a)
    #print(dp)
print(max([dp[x][y] for x in range(N+1) for y in range(N+1) if x+y==N]))
# -*- coding: utf-8 -*-

n = int(input())

def gcd(a, b):
    if b==0:
        return a
    return gcd(b, a%b)

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

ans = 1
for _ in range(n):
    t = int(input())
    ans = lcm(ans, t)

print(ans)


### FIXED CODE ###

from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)
 
n = int(input())
res = 1
for i in range(n):
    t = int(input())
    res = lcm(res, t)
print(res)
# https://atcoder.jp/contests/abc099/tasks/abc099_d
# さまざまな合わせ技
# ダイクストラ、全探索

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため



# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations

from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix, lil_matrix
# 0 まずはダイクストラでX→Yの最小コストを求めておく
# 1 座標ごとに3つのグループわけができる(n=1のときだけ場合分け
# 2 グループごとに色をカウント
# 3 各グループの色を仮定して全探索

N, C = read_ints()
D = read_matrix(C)
D = csr_matrix(D)
# D = dijkstra(D)


# 1 座標のグループわけ
Cmap = read_matrix(N)
lsbymod = defaultdict(lambda: [])
for i in range(N):
    for j in range(N):
        lsbymod[(i + j + 2) % 3].append(Cmap[i][j] - 1)

# グループごとに色のカウント
for k, v in lsbymod.items():
    lsbymod[k] = Counter(v)

# 各グループの色を仮定して全探索


# print(D)
# print(lsbymod)


def ret_score(*arg):
    # 各仮定から違和感を計算
    ret = 0
    for i in range(3):
        for k, v in lsbymod[i].items():
            ret += v * D[k, arg[i]]
    return ret


ans = 2**63
for a, b, c in permutations(range(C), 3):
    # print(a, b, c, ret_score(a, b, c))
    ans = min(ans, ret_score(a, b, c))

print(ans)


### FIXED CODE ###

# https://atcoder.jp/contests/abc099/tasks/abc099_d
# さまざまな合わせ技
# ダイクストラ、全探索

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため



# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations

# from scipy.sparse.csgraph import dijkstra
# from scipy.sparse import csr_matrix, lil_matrix
# 0 まずはダイクストラでX→Yの最小コストを求めておく #えーーーーこれ想定されてないの？
# 1 座標ごとに3つのグループわけができる(n=1のときだけ場合分け
# 2 グループごとに色をカウント
# 3 各グループの色を仮定して全探索

N, C = read_ints()
D = read_matrix(C)
# D = csr_matrix(D)
# D = dijkstra(D)


# 1 座標のグループわけ
Cmap = read_matrix(N)

if N == 1:
    print(0)
    exit()

lsbymod = defaultdict(lambda: [])
for i in range(N):
    for j in range(N):
        lsbymod[(i + j + 2) % 3].append(Cmap[i][j] - 1)

# グループごとに色のカウント
for k, v in lsbymod.items():
    lsbymod[k] = Counter(v)

# 各グループの色を仮定して全探索


# print(D)
# print(lsbymod)


def ret_score(*arg):
    # 各仮定から違和感を計算
    ret = 0
    for i in range(3):
        for k, v in lsbymod[i].items():
            ret += v * D[k][arg[i]]
    return ret


ans = 2**63
for a, b, c in permutations(range(C), 3):
    # print(a, b, c, ret_score(a, b, c))
    ans = min(ans, ret_score(a, b, c))

print(ans)
r, g, b = input().split()
a = int(r + g + b)
print(["YES", "NO"][a % 4])

### FIXED CODE ###

print(["NO","YES"][int(input().replace(" ", ""))%4==0])
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


def calc_rle(s):
    tmp, count, ans = s[0], 1, ""
    for i in range(1, len(s)):
        if tmp == s[i]:
            count += 1
        else:
            ans += tmp + str(count)
            tmp = s[i]
            count = 1
    ans += tmp + str(count)
    return ans


s = S()
rle = calc_rle(s)
if rle[0] == 'W':
    rle = rle[2:]
if len(rle)  >= 4 and rle[-2] == 'B':
    rle = rle[:-2]
rle = [[rle[i], eval(rle[i+1])] for i in range(0, len(rle), 2)]
ans = 0
for i in range(0, len(rle), 2):
    ans += rle[i][1] * rle[i + 1][1]
    if i + 2 < len(rle):
        rle[i + 2][1] += rle[i][1]
print(ans)


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
ans = 0
w_cnt = 0
for i in range(len(s)):
    if s[i] == "W":
        ans += i - w_cnt  # その W の場所までにあった B の数
        w_cnt += 1

print(ans)
x=int(input())
ans=0
ans+=(x//)*2
if x%11==0:
    print(ans)
elif x%11<=6:
    print(ans+1)
else:
    print(ans+2)
    

### FIXED CODE ###

x=int(input())
ans=0
ans+=(x//11)*2
if x%11==0:
    print(ans)
elif x%11<=6:
    print(ans+1)
else:
    print(ans+2)
a,b=input(int,input().split())
if a<10,b<10:
  print(a*b)
else:
  print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
# coding: utf-8

num, blue_num, red_num = map(int, input().split())
all_ball = blue_num + red_num
if blue_num == 0:
    print(0)
else:
    rest = int(num % all_ball)
    if rest <= blue_num:
        blue = rest
    count = int(num / all_ball)
    print((count) * blue_num + blue)



### FIXED CODE ###

# coding: utf-8
import math

count = 0
num, blue_num, red_num = map(int, input().split())
all_ball = blue_num + red_num
count = num // all_ball
rest = num % all_ball
print(count * blue_num + min(rest, blue_num))
N,M = (int(x) for x in input().split())

p_y_list = []
y_count = [1]*(M+1)

for i in range(M):
    p_y_list.append([int(x) for x in input().split()])
    p_y_list[i].append(i)
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_id_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))

### FIXED CODE ###

N,M = (int(x) for x in input().split())

p_y_list = [0]*M
y_count = [1]*(N+1)

for i in range(M):
    p,y = (int(x) for x in input().split())
    p_y_list[i] = [p,y,i]
p_y_list.sort(key = lambda x:x[1])

for i in p_y_list:
    i[1] = y_count[i[0]]
    y_count[i[0]] += 1

p_y_list.sort(key = lambda x:x[2])
for i in p_y_list:
    print(str(i[0]).rjust(6,"0") + str(i[1]).rjust(6,"0"))
a,b,c,d,e,f=map(int,input().split())
q=[[0,0]]
ans=0
while len(q)>0:
  x,y=pop(q)
  if x+y+100*a<=f:
    q+=[[x+100*a,y]]
  if x+y+100*b<=f:
    q+=[[x+100*b,y]]
  if y+c<=(x-y)*e/100 and x+y+c<=f:
    q+=[[x+c,y+c]]
    ans=max(ans,100*(y+c)/(x+y+c))
  if y+d<=(x-y)*e/100 and x+y+d<=f:
    q+=[[x+d,y+d]]
    ans=max(ans,100*(y+d)/(x+y+d))
print(ans)
    

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
aa=-1
ans=[0,0]
for i in range(0,f+1,a*100):
  for j in range(0,f+1-i,b*100):
    for k in range(0,int(e*(i+j)/100)+1,c):
      for l in range(0,int(e*(i+j)/100)+1-k,d):
        if i+j+k+l>f:
          continue
        if i+j>0 and aa<(k+l)/(i+j+k+l):
          aa=(k+l)/(i+j+k+l)
          ans=[i+j+k+l,k+l]
print(ans[0],ans[1])
import sys

input=sys.stdin.readline

mod=10*9+7

N=int(input())
taka=[tuple(map(int,input().split())) for i in range(N)]
taka.sort()

V=[0]+[taka[i][1] for i in range(N)]+[10**15]
cummin=[V[i] for i in range(N+2)]
for i in range(N,-1,-1):
    cummin[i]=min(cummin[i],cummin[i+1])
cummax=[V[i] for i in range(N+2)]
for i in range(1,N+2):
    cummax[i]=max(cummax[i],cummax[i-1])

cnt=0
for i in range(1,N+1):
    if V[i]>cummax[i-1] and cummin[i+1]>V[i]:
        cnt+=1

if cnt:
    print(pow(2,N-cnt,mod))
else:
    all=pow(2,N,mod)
    highid,lowid=-1,-1
    Vmax=cummax[-2]
    Vmin=cummin[1]
    for i in range(1,N+1):
        if V[i]==Vmax:
            highid=i
        elif V[i]==Vmin:
            lowid=i
    high=pow(2,highid-1,mod)
    low=pow(2,N-lowid,mod)
    if highid>lowid:
        highlow=pow(2,N+1-highid-lowid,mod)
    else:
        highlow=1
    ans=all+highlow-high-low
    print(ans%mod)


### FIXED CODE ###

class BIT():
    def __init__(self,n,mod):
        self.BIT=[0]*(n+1)
        self.num=n
        self.mod=mod

    def query(self,idx):
        res_sum = 0
        mod=self.mod
        while idx > 0:
            res_sum += self.BIT[idx]
            res_sum%=mod
            idx -= idx&(-idx)
        return res_sum

    #Ai += x O(logN)
    def update(self,idx,x):
        mod=self.mod
        while idx <= self.num:
            self.BIT[idx] += x
            self.BIT[idx]%=mod
            idx += idx&(-idx)
        return

import sys,bisect

input=sys.stdin.readline

mod=10**9+7
inv=pow(2,mod-2,mod)

N=int(input())
taka=[tuple(map(int,input().split())) for i in range(N)]
taka.sort()

V=[0]+[taka[i][1] for i in range(N)]+[10**15]
cummin=[V[i] for i in range(N+2)]
for i in range(N,-1,-1):
    cummin[i]=min(cummin[i],cummin[i+1])
cummax=[V[i] for i in range(N+2)]
for i in range(1,N+2):
    cummax[i]=max(cummax[i],cummax[i-1])

const=[]
for i in range(1,N+1):
    R=bisect.bisect_right(cummin,V[i])-1
    L=bisect.bisect_left(cummax,V[i])
    const.append((L,R))


Lconst=[(i,10**15) for i in range(N+1)]
for L,R in const:
    pL,pR=Lconst[L]
    Lconst[L]=(L,min(R,pR))

_const=[]
for i in range(1,N+1):
    L,R=Lconst[i]
    if R!=10**15:
        _const.append((L,R))

const=[]
for L,R in _const:
    while const and const[-1][1]>=R:
        const.pop()
    const.append((L,R))


M=len(const)
const=[(-10**15,0)]+const
Rconst=[const[i][1] for i in range(M+1)]
B=BIT(M,mod)
dp=[1]*(M+1)
for i in range(1,M+1):
    L,R=const[i]
    id=bisect.bisect_left(Rconst,L)
    res=(B.query(i-1)-B.query(id-1))%mod
    l,r=const[id]
    l=max(l,Rconst[id-1]+1)
    res+=dp[id-1]*(pow(2,r-L+1,mod)-1)*pow(2,L-l,mod)%mod
    res%=mod
    dp[i]=res
    if i!=M:
        nR=Rconst[i+1]
        add=dp[i]*(pow(2,nR-R,mod)-1)%mod
        add%=mod
        B.update(i,add)

cnt=0
data=[0]*(N+2)
for i in range(1,M+1):
    L,R=const[i]
    data[L]+=1
    data[R+1]+=-1
for i in range(1,N+2):
    data[i]+=data[i-1]
for i in range(1,N+1):
    if data[i]==0:
        cnt+=1
ans=pow(2,cnt,mod)*dp[M]
ans%=mod
print(ans)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, K = mapint()
As = list(mapint())
mod = 10**9+7

pos = []
neg = []
for a in As:
    if a>=0:
        pos.append(a)
    else:
        neg.append(a)
pos.sort(reverse=True)
neg.sort(reverse=True)
ans = 1
lenp, lenn = len(pos), len(neg)
if (lenp+lenn)==K:
    for a in As:
        ans *= a
        ans %= mod
    print(ans)
elif lenn==0:
    for i in range(K):
        ans *= pos[i]
        ans %= mod
    print(ans)
elif lenp==0:
    if K%2==0:
        for i in range(K):
            ans *= neg[i]
            ans %= mod
        print(ans)
    else:
        for i in range(K-1, -1, -1):
            ans *= neg[i]
            ans %= mod
        print(ans)        
else:
    p, n = 0, 0
    while p+n+1<K:
        if p+2<lenp and n+2<lenn:
            if pos[p]*pos[p+1]>=neg[n]*neg[n+1]:
                ans *= pos[p]
                p += 1
            else:
                ans *= neg[n]*neg[n+1]
                n += 2
        elif n+2<lenn:
            ans *= neg[n]*neg[n+1]
            n += 2
        else:
            ans *= pos[p]
            p += 1
        ans %= mod
    if p+n<K:
        ans *= pos[p]
        ans %= mod
    print(ans)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

def solve():
    N, K = mapint()
    As = list(mapint())
    mod = 10**9+7
    pos = []
    neg = []
    for a in As:
        if a>=0:
            pos.append(a)
        else:
            neg.append(a)

    pos.sort(reverse=True)
    neg.sort()
    lenp = len(pos)
    lenn = len(neg)
    if not pos and K%2==1:
        ans = 1
        for i, n in enumerate(neg[::-1]):
            ans *= n
            ans %= mod
            if i==K-1:
                break
        return ans
    if lenp+lenn==K and (K-lenp)%2==1:
        ans = 1
        pos.extend(neg)
        pos.sort(reverse=True)
        for i, p in enumerate(pos):
            ans *= p
            ans %= mod
            if i==K-1:
                break
        return ans
    ans = 1
    pcnt = 0
    ncnt = 0
    for i in range(K//2):
        if pcnt*2+1>=lenp:
            ans *= neg[ncnt*2]*neg[ncnt*2+1]
            ans %= mod
            ncnt += 1
        elif ncnt*2+1>=lenn:
            ans *= pos[pcnt*2]*pos[pcnt*2+1]
            ans %= mod
            pcnt += 1
        elif pos[pcnt*2]*pos[pcnt*2+1]>neg[ncnt*2]*neg[ncnt*2+1]:
            ans *= pos[pcnt*2]*pos[pcnt*2+1]
            ans %= mod
            pcnt += 1
        else:
            ans *= neg[ncnt*2]*neg[ncnt*2+1]
            ans %= mod
            ncnt += 1
    if K%2==1:
        ans *= pos[pcnt*2]
        ans %= mod
    return ans

print(solve())
N = int(input())
H = list(map(int, input().split()))

cnt = 0
for i in range(len(H)):
    if (max(H[0:i]) <= H[i]):
        cnt += 1

print(cnt)


### FIXED CODE ###

A,B = map(int,input().split())
if A == B:
	print(A+B)
elif A < B:
    print(B*2-1)
else:
    print(A*2-1)
a,b,c,x,y=map(int,input().split())
if a+b>2*c and x>y:
    if a<2*c:
        print(2*c*y+a*(x-y))
    else:
        print(2*c*x)
elif a+b>2*c and x<y:
    if b<2*c:
        print(2*c*x+b*(y-x))
    else:
        print(2*c*y)
else:
    print(a*x+b*y)

### FIXED CODE ###

a=input()
print(700+a.count("o")*100)
s = input()
K = int(input())
substring = []
for i in range(len(s) + 1):
	for j in range(i + 1, len(s) + 1):
		substring.append(s[i:j])
substring.sort()
if K <= 1 or len(s) <= 1:
	print(s)
else:
	print(substring[K + 1])

### FIXED CODE ###

s = input()
K = int(input())
substr = set()
for i in range(len(s)):
    for j in range(i+1, i+K+1):
        substr.add(s[i:j])
print(sorted(substr)[K-1])
a, b = map(int, sys.stdin.readline().strip)
sys.stdout.write(max(a+b, a-b, a*b) + '\n')

### FIXED CODE ###

a,b = map(int,input().split())
print(max(a+b, a-b, a*b))