Harryxun/stf_run huggingface dataset:
# nCr的にn//2に近いほうがいいに決まっている
# まあnCrは計算しなくていい

n = int(input())
arr = sorted(list(map(int, input().split())))


def lower_bound(arr, t):
    l, r = 0, len(arr)
    while l < r:
        mid = (l + r) // 2
        if arr[mid] < t:
            l = mid + 1
        else:
            r = mid
    return l


lb = lower_bound(arr[:-2], arr[-1] // 2)
lb_left = max(0, lb - 1)
if lb == lb_left:
    raise ValueError("omg")
if arr[lb] <= arr[lb_left]:
    print(arr[-1], arr[lb_left])
else:
    print(arr[-1], arr[lb])


### FIXED CODE ###

# nCr的にn//2に近いほうがいいに決まっている
# まあnCrは計算しなくていい

n = int(input())
arr = sorted(list(map(int, input().split())))


def lower_bound(arr, t):
    l, r = 0, len(arr)
    while l < r:
        mid = (l + r) // 2
        if arr[mid] < t:
            l = mid + 1
        else:
            r = mid
    return l


lb = lower_bound(arr[:-2], round(arr[-1] / 2))
lb_left = max(0, lb - 1)
if abs(round(arr[-1] / 2) - arr[lb]) >= abs(round(arr[-1] / 2) - arr[lb_left]):
    print(arr[-1], arr[lb_left])
else:
    print(arr[-1], arr[lb])
n,k=map(int,input().split())
e=[0]*(k)
e[-2]=1
now=k
while now!=1:
  if now%2==0 and now!=2:
    now=now//2
    e[now-2]+=1
  elif now==2:
    now+=-1
    e[now-1]+=1
  else:
    now=now//2
    e[now-1]+=1
e_=[]
for i in range(k):
  if i==0:
    e_.append(e[k-1-i])
  else:
    e_.append(e[k-1-i]+e_[-1])   
ans=0    
if n<k:
  for i in range(n):
    ans+=((1/2)**e_[k-1-i])*(1/n)
  print(ans)  
else:
  for i in range(k):
    ans+=((1/2)**e_[k-1-i])*(1/n)
  ans+=(1/n)*(n-k)
  print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
d=0
for a in range(1,n+1):
  b=0
  while a<k:
    b+=1
    a=a*2
  d+=(1/2)**b
print(d/n)
N = input()
l = len(N)

if n[i::] == "9"*(l-1):
    print(int(n[0])+9*(l-1))
else:
    print(int(n[0])-1+9*(l-1))

### FIXED CODE ###

N = input()
l = len(N)

if N[1::] == '9'*(l-1):
    print(int(N[0])+9*(l-1))
else:
    print(int(N[0])-1+9*(l-1))
K,X=map(int,input().split())
if 500*K>=X:
	print("Yes")
  else:
  	print("No")


### FIXED CODE ###

K,X=map(int,input().split())
if 500*K>=X:
	print("Yes")
else:
  	print("No")
N, K = map(int, input().split())
arr = list(map(int,input().split()))
left = []
right = []
for i in arr:
    if i < 0:
        left.append(abs(i))
    else:
        right.append(i)
left.sort()
tmp = 0
count = 0
if len(right) == 0:
    print(left[K-1])
    exit()
if len(right) >= K:
    tmp += right[K-1]
    i = 1
    while True:
        if len(left) < i or K-i-1 < 0:
            break
        tmp2 = right[K-i-1] + left[i-1] + min(right[K-i-1],left[i-1])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
else:
    tmp += right[-1]+left[K-len(right)-1]+min(right[-1],left[K-len(right)-1])
    i = 1
    while True:
        if K-len(right)-1+i >= K or -1-i < 1-len(right):
            break
        tmp2 = right[-1-i] + left[K-len(right)-1+i] + min(right[-1-i],left[K-len(right)-1+i])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
print(tmp)

### FIXED CODE ###

N, K = map(int, input().split())
arr = list(map(int,input().split()))
left = []
right = []
for i in arr:
    if i < 0:
        left.append(abs(i))
    else:
        right.append(i)
left.sort()
tmp = 0
count = 0
if len(right) == 0:
    print(left[K-1])
    exit()
if len(right) >= K:
    tmp += right[K-1]
    i = 1
    while True:
        if len(left) < i or K-i-1 < 0:
            break
        tmp2 = right[K-i-1] + left[i-1] + min(right[K-i-1],left[i-1])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
else:
    tmp += right[-1]+left[K-len(right)-1]+min(right[-1],left[K-len(right)-1])
    i = 1
    while True:
        if K-len(right)-1+i >= K or i >= len(right) or K-len(right)-1+i >= len(left)-1:
            break
        tmp2 = right[-1-i] + left[K-len(right)-1+i] + min(right[-1-i],left[K-len(right)-1+i])
        i += 1
        if tmp2 < tmp:
            tmp = tmp2
print(tmp)
import sys
btns = sys.stdin.readline().split()
X=btns[0]
Y=btns[1]
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)



### FIXED CODE ###

btns=input().split()
X=int(btns[0])
Y=int(btns[1])
Coins=0

for i in range(2):
    if X > Y:
        Coins+=X
        X -= 1
    else:
        Coins+=Y
        Y-=1

print(Coins)
N, K = map(int, input().split())
A = list(map(int, input().split()))
b = [0 for i in range(N+2)]
if K > 70:
    ans = [N for i in range(N)]
    print(*ans)
else:
    for _ in range(K):
        for i in range(N+2):
            b[i] = 0
        for i in range(N):
            b[max(0, i+1-a[i])] += 1
            b[min(N+1, i+1+a[i]+1)] -= 1
        for i in range(1, N+1):
            b[i] += b[i-1]
            a[i-1] = b[i]
    print(*a)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
b = [0 for i in range(N+2)]
if K > 70:
    ans = [N for i in range(N)]
    print(*ans)
else:
    for _ in range(K):
        for i in range(N+2):
            b[i] = 0
        for i in range(N):
            b[max(0, i+1-A[i])] += 1
            b[min(N+1, i+1+A[i]+1)] -= 1
        for i in range(1, N+1):
            b[i] += b[i-1]
            A[i-1] = b[i]
    print(*A)
S = map(str, input())
list = list(S)
a = int(list.count('+'))
b = ist(list.count('-'))
print('a-b')

### FIXED CODE ###

S = str(input())
list = list(S)
num = list.count('+')
print(num - (4-num))
tmp = input().split()
N = int(tmp[0])
S = [0 for i in range(N)]
T = [0 for i in range(N)]

for n in range(N):
    tmp = input().split()
    S[n] = int(tmp[0])
    T[n] = int(tmp[1])


#total 
mod =  1000000007

dp[0] = 0

for i in range(N+1):
    
    out = 0
    for k in range(i):
        if S[k]*S[i]+T[k]*T[i] == 0:
            ++out
    dp[i+1] = dp[i]*2 - out 
    dp[i+1] = dp[i+1] %mod
print(dp[N])


### FIXED CODE ###

from collections import deque

tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])
ve = [deque() for _ in range(N)]
todo = deque()

s = 0
for m in range(M):
    S, T  = map(int,input().split())
    ve[S-1].append(T)
    ve[T-1].append(S)

visited = [False]*N
dist = [0]*N
todo.append(1)
   
while len(todo)>0:
    now = todo.popleft()   
    while len(ve[now-1])>0:
        sr = ve[now-1].pop()
        if  visited[sr-1]: continue
        dist[sr-1] = now
        visited[sr-1] = True
        todo.append(sr)

print('Yes')
[print(i) for i in dist[1:]]
class UnionFind:
    def __init__(self, length):
        self.parent_indexes = [-1]* length
        
    def union(self, i, j):
        # iが所属する集団のサイズ>=jが所属する集団のサイズにする
        if self.get_group_size(i) < self.get_group_size(j):
            i, j = j, i
        self.parent_indexes[i] = - self.get_group_size(i) - self.get_group_size(j)
        self.parent_indexes[j] = i
        
    # i番目の要素が所属する集団の親nodeのindexを返す
    # メモ化もする
    def find(self, i):
        if self.parent_indexes[i] < 0:
            return i
#         parent_index = self.find(i)
#         parent_index = self.find(self.parent_indexes[i])
        parent_index = self.find(self.parent_indexes[i])
        self.parent_indexes[i] = parent_index
        return parent_index

    def get_group_size(self, i):
        return - self.parent_indexes[self.find(i)]
    
    def are_in_the_same_group(self, i, j):
        return self.find(i) == self.find(j)
    
    
n, q = list(map(lambda x: int(x), input().split()))
uf = UnionFind(n)
for _ in range(q):
    t, u, v = list(map(lambda x: int(x), input().split()))
    if t == 0:
        uf.union(u, v)
        continue
    print('1') if uf.are_in_the_same_group(u, v) else print('0')
        
    


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
      
n, q = list(map(lambda x: int(x), input().split()))
uf = UnionFind(n)
for _ in range(q):
    t, u, v = list(map(lambda x: int(x), input().split()))
#     print(uf.parent_indexes)
    if t == 0:
        uf.union(u, v)
        continue
    print('1') if uf.same(u, v) else print('0')
def main():
    i = 1
    while True:
        x = [int(i) for i in input().split()]
        if x == 0:
            break
        print "Case %d: %d" % (i, x)
        i += 1

if __name__ == '__main__':
main()

### FIXED CODE ###

count = 1

while True:
    x = int(input())
    if x != 0:
        print("Case {0}: {1}".format(count, x))
        count += 1

    else:
        break
N = int(input())
S = input()
K = int(input())

target = S[K]
S = list(S)

for i in range(N):
   if S[i] == target:
       pass
   else:
       S[i] = "*"
        
S = "".join(S)
print(S)

### FIXED CODE ###

N = int(input())
S = str(input())
K = int(input())

target = S[K-1]
S = list(S)

for i in range(N):
   if S[i] == target:
       pass
   else:
       S[i] = "*"
        
S = "".join(S)
print(S)
S = list(map(int, input()))

count = 0
tmp = S[0]
for ii in S:
    if ii != tmp:
        count += 1
    tmp = abs(tmp-1)

print(count)

### FIXED CODE ###

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

ans = 0
if A == B:
    ans = A + B
elif A > B:
    ans = A + (A - 1)
else:
    ans = B + (B - 1)

print(ans)
def gcd(a, b):
	if b == 0:
		return 1
	_max = max(a, b)
	_min = min(a, b)
	rest = _max % _min
	if rest == 0:
		return _min
	else:
		return gcd(_min, rest)

N, X = map(int, raw_input().split())
x = map(int, raw_input().split())
x.sort()
	
for i in range(N):
	if X < x[i]:
		x.insert(i, X)
		break
diff = []
for i in range(N):
	d = abs(x[i] - x[i+1])
	diff.append(d)

res = diff[0]
for i in range(N - 1):
	res = gcd(res, diff[i + 1])
print res



### FIXED CODE ###

def gcd(a, b):
	if b == 0:
		return 1
	_max = max(a, b)
	_min = min(a, b)
	rest = _max % _min
	if rest == 0:
		return _min
	else:
		return gcd(_min, rest)

N, X = map(int, raw_input().split())
x = map(int, raw_input().split())
x.sort()
	
for i in range(N):
	if X < x[i]:
		x.insert(i, X)
		break
if len(x) == N:
	x.append(X)
diff = []
for i in range(N):
	d = abs(x[i] - x[i+1])
	diff.append(d)

res = diff[0]
for i in range(N - 1):
	res = gcd(res, diff[i + 1])
print res
bimport math
n=int(input())
miti= list(map(int,[input() for i in range(5)]))
print(4+math.ceil(n/min(miti)))


### FIXED CODE ###

import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
miti=[a,b,c,d,e]
mini=min(miti)
retu=math.ceil(n/mini)
print(4+retu)
soboe = raw_input()
al = soboe.split(' ')
a = al[0]
b = al[1]
if a < b :
    print('a < b') 
elif a > b :
    print('a > b')
else a == b :
    print('a == b')

### FIXED CODE ###

soboe = raw_input()
al = soboe.split(' ')
a = int(al[0])
b = int(al[1])
if a < b :
    print('a < b') 
elif a > b :
    print('a > b')
elif a == b :
    print('a == b')
import math
X = int(input())
answer = 0

for i in range(2,math.floor(X)):
  for j in range(2,11):
    if i**J <= X:
      answer = max(answer,i**j)
      
print(answer)

### FIXED CODE ###

import math
X = int(input())
answer = 0
for i in range(1,math.ceil(X**0.5)+1):
  for j in range(2,11):
    if i**j <= X:
      answer = max(i**j,answer)

print(answer)
n,a,b=map(int,input().split())
print(min(a,b),max(a+b-n))

### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(a,b),max(a+b-n,0))
import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = np.zeros(N-1, np.int64)

c = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        d3 = abs(Y - i) + 1 + abs(j - X)
        ans[min(d1, d2, d3) - 1] += 1

[print(ans[i]) for i in range(N - 1)]


### FIXED CODE ###

import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0] * (N-1)

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]
M = int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
is_prime = [True] * (ma + 1)
for i in A:
    if not is_prime[i]:
        continue
    for j in range(i * 2, ma + 1, i):
        is_prime[j] = False
k=[i for i in range(ma + 1) if is_prime[i]]
N=[]
if A[0] !=A[1]:
    N.append(A[0])
for i in range(1,len(A)-1):
    if A[i-1]!=A[i] and A[i]!=A[i+1]:
        N.append(A[i])
if A[len(A)-2] != A[len(A)-1]:
    N.append(A[len(A)-1])
s=set(k) & set(N)
print(len(s))

### FIXED CODE ###

M = int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
is_prime = [True] * (ma + 1)
for i in A:
    if not is_prime[i]:
        continue
    for j in range(i * 2, ma + 1, i):
        is_prime[j] = False
k=[i for i in range(ma + 1) if is_prime[i]]
N=[]
if len(A)==1:
    print(1)
else:
    if A[0] !=A[1]:
        N.append(A[0])
    for i in range(1,len(A)-1):
        if A[i-1]!=A[i] and A[i]!=A[i+1]:
            N.append(A[i])
    if A[len(A)-2] != A[len(A)-1]:
        N.append(A[len(A)-1])
    s=set(k) & set(N)
    print(len(s))
print(input().replace(',','')

### FIXED CODE ###

print(*input().split(','))
x,a,b = map(int,input().split())
print(min(abs(x-a),abs(x-b))

### FIXED CODE ###

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

if abs(x-a)>abs(x-b):
  print("B")
  
else:
  print("A")
from fractions import gcd
from functools import reduce


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

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

l=reduce(lcm,A)
    
ans=0
for i in range(N):
    ans+=l//A[i]

print(ans%(10**9+7))

### FIXED CODE ###

N,M=list(map(int,input().split()))
if N>M:
    print("No")
else:
    print("Yes")
d = ["A":"T","G":"C","C":"G","T":"A"]
print(d[input()])

### FIXED CODE ###

b = input()
if b == "A":
    print("T")
if b == "G":
    print("C")
if b == "C":
    print("G")
if b == "T":
    print("A")
n=int(input())
ans=n
for i in range(1,n):
    for j in range(i):
        if (p[i]>p[j]):
            ans-=1
            break
print(ans)

### FIXED CODE ###

n=int(input())
p=[int(i) for i in input().split()]
flag=p[0]
ans=1
for i in range(1,n):
    if (p[i]<flag):
        flag=p[i]
        ans+=1
print(ans)
def abc151d_maze_master():
    h, w = map(int, input().split())
    s = []
    max_val = 0
    for i in range(h):
        s.append(input())
    for hi in range(h):
        for wi in range(w):
            if s[hi][wi] == '#': continue
            flg = [[-1] * w for _ in range(h)]
            flg[hi][wi] = 0
            q = [(0, hi, wi)]
            heapq.heapify(q)
            while len(q) > 0:
                d, hj, wj = heapq.heappop(q)
                for dh, dw in zip([0, 0, 1, -1], [1, -1, 0, 0]):
                    if 0 <= hj + dh < h and 0 <= wj + dw < w and s[hj + dh][wj + dw] != '#' and \
                            (flg[hj + dh][wj + dw] == -1 or flg[hj + dh][wj + dw] > flg[hj][wj] + 1):
                        heapq.heappush(q, (d + 1, hj + dh, wj + dw))
                        flg[hj + dh][wj + dw] = flg[hj][wj] + 1
                # print(q)
            max_val = max(max_val, max([max(v) for v in flg]))
    print(max_val)


abc151d_maze_master()

### FIXED CODE ###

import heapq


def abc151d_maze_master():
    h, w = map(int, input().split())
    s = []
    max_val = 0
    for i in range(h):
        s.append(input())
    for hi in range(h):
        for wi in range(w):
            if s[hi][wi] == '#': continue
            flg = [[-1] * w for _ in range(h)]
            flg[hi][wi] = 0
            q = [(0, hi, wi)]
            heapq.heapify(q)
            while len(q) > 0:
                d, hj, wj = heapq.heappop(q)
                for dh, dw in zip([0, 0, 1, -1], [1, -1, 0, 0]):
                    if 0 <= hj + dh < h and 0 <= wj + dw < w and s[hj + dh][wj + dw] != '#' and \
                            (flg[hj + dh][wj + dw] == -1 or flg[hj + dh][wj + dw] > flg[hj][wj] + 1):
                        heapq.heappush(q, (d + 1, hj + dh, wj + dw))
                        flg[hj + dh][wj + dw] = flg[hj][wj] + 1
                # print(q)
            max_val = max(max_val, max([max(v) for v in flg]))
    print(max_val)


abc151d_maze_master()
N, M = map(int, input("").split(" "))

A = map(int, input("").split(" "))
A = list(A)
A.sort()

potentials = []
for i in range(M):
    B, C = map(int, input("").split(" "))

    potentials.append((B, C))

potentials.sort(key=lambda x: x[1], reverse=True)

c = 0
for p in potentials:
    if c < len(A):
        for b in range(p[0]):
            if p[1] > A[c]:
                A[c] = p[1]
                c += 1
            else:
                break

print(sum(A))


### FIXED CODE ###

N, M = map(int, input("").split(" "))

A = map(int, input("").split(" "))
A = list(A)
A.sort()

potentials = []
for i in range(M):
    B, C = map(int, input("").split(" "))

    potentials.append((B, C))

potentials.sort(key=lambda x: x[1], reverse=True)

c = 0
for p in potentials:
    for b in range(p[0]):
        if p[1] > A[c]:
            A[c] = p[1]
            c += 1
            if c >= len(A):
                break
        else:
            break
    if c >= len(A):
        break

print(sum(A))
mod=10**9+7

n=int(input())

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

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

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

lcma=1

for i in range(n):
    lcma=lcm(lcma,a[i])

ans=0

for i in range(n):
    ans=(ans+lcma//a[i])

print(ans%mod)



### FIXED CODE ###

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

if n==m:
    print('Yes')
else:
    print('No')
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
B=np.array(b)
count=0
for i in range(n):
    A=np.array(list(map(int,input().split())))
    S=np.dot(B,A) + c
    if(S>0):
        count+=1
print(count)

### FIXED CODE ###

N, M, C = map(int, input().split())
B = list(map(int, input().split()))
count=0
for i in range(N):
    A = list(map(int, input().split()))
    SUM=0
    for j in range(M):
        SUM += A[j]*B[j]
    if SUM+C > 0:count += 1
print(count)
N = int(input().remove(" ", ""))

print("Yes" if round(N**0.5)**2 == N else "No")

### FIXED CODE ###

N = int(input().replace(" ", ""))
 
print("Yes" if round(N**0.5)**2 == N else "No")
s = input()
i = 1
flag = True
c in s:
  if (i % 2 == 0 and c == "L") or (i % 2 == 1 and c == "R"):
    print("No")
    exit
print("Yes")


### FIXED CODE ###

s = input()
i = 0
flag = True
for c in s:
  i += 1
  if (i % 2 == 0 and c == "R") or (i % 2 == 1 and c == "L"):
    print("No")
    exit(0)
print("Yes")
k = int(input())

l = []
for i in range(5):
    ten = 10**i
    for j in range(1,100):
        a = ten
        b = j
        n = a*b-1
        if n == 0:
            continue
        s = sum(map(int,str(n)))
        l.append([n/s,n])
l.sort()
now = 0
count = 0
i = 0
while count < k:
    if l[i][1] > now:
        now = l[i][1]
        count += 1
        print(l[i][1])
    i += 1


### FIXED CODE ###

k = int(input())

l = []
for i in range(17):
    ten = 10**i
    for j in range(1,1000):
        a = ten
        b = j
        n = a*b-1
        if n == 0:
            continue
        s = sum(map(int,str(n)))
        l.append([n/s,n])
l.sort()
now = 0
count = 0
i = 0
while count < k:
    if l[i][1] > now:
        now = l[i][1]
        count += 1
        print(l[i][1])
    i += 1
import sys
sys.setrecursionlimit(1000000000)

def rec(n):
    if n == 1:
        return 1
    return rec(n-1) + 1


print(rec(800000))


### FIXED CODE ###

A, B = map(int, input().split())
print(max(A*2-1,A+B,B*2-1))
sum = 0
n = input()
l = [list(map(int, input().split()) for i in range(3))]

for i in range(n):
  sum += l[1][i]
  if l[0][i+1] == l[0][i]+1:
    sum += l[2][i]

print(sum)

### FIXED CODE ###

sum = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(3)]

for i in range(n-1):
  sum = sum + l[1][i]
  if l[0][i+1] - l[0][i] == 1:
    sum = sum + l[2][l[0][i]-1]
sum = sum + l[1][n-1]
print(sum)
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,k=nii()
a=lnii()

for i in range(k,n):
  old=a[i-k]
  new=a[i]
  if old<p:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,k=nii()
a=lnii()

for i in range(k,n):
  old=a[i-k]
  new=a[i]
  if old<new:
    print('Yes')
  else:
    print('No')
h, a = map(int, input(), split())
n = 0
while h <= 0:
    h = h - a
    n = n + 1
print(n) 

### FIXED CODE ###

h, a = map(int, input(). split())
n = 0
while True:
    h = h - a
    n = n + 1
    if h <= 0:
        break
print(n)
t = list(input())
tl = len(t)

for i in range(tl):
    if t[i] != '?':
        continue

    if tl == 1:
        t[i] = 'D'
    elif t[i-1] == 'P':
        t[i] = 'D'
    elif t[i+1] == '?':
        t[i] = 'P'
    elif t[i+1] == 'D':
        t[i] = 'P'
    else:
        t[i] = 'D'

print(''.join(t))


### FIXED CODE ###

t = list(input())
tl = len(t)

for i in range(tl):
    if t[i] != '?':
        continue

    if tl == 1:
        t[i] = 'D'
    elif i == tl - 1:
        t[i] = 'D'
    elif t[i-1] == 'P':
        t[i] = 'D'
    elif t[i+1] == '?':
        t[i] = 'P'
    elif t[i+1] == 'D':
        t[i] = 'P'
    else:
        t[i] = 'D'

print(''.join(t))
import math

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

print(math.ceil(n/(2d+1.0)))


### FIXED CODE ###

import math

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

print(math.ceil(n/(2*d+1.0)))
a, b, c = map(int, input().split)
num = a + b + c
if (num >= 22):
  print('bust')
else:
  print('win')
  

### FIXED CODE ###

a, b, c = map(int, input().split())
num = a + b + c
if (num >= 22):
  print('bust')
else:
  print('win')
s=input()
if s[3]=s[4] and s[5]=s[6]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
if s[2]==s[3] and s[4]==s[5]:
  print('Yes')
else:
  print('No')
k = int(input())
[a,b] = [int(i) for i in input().split()]
f = 0
for i in range(a,b+1):
	if i % k == 0:
    	f = 1
if f:
	print("OK")
else:
	print("NG")

### FIXED CODE ###

k = int(input())
[a,b] = [int(i) for i in input().split()]
f = 0
for i in range(a,b+1):
  if i % k == 0:
    f = 1
if f:
  print("OK")
else:
  print("NG")
c1 = input()
c2 = input()
c2.reverse()

if c1 == c2:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

c1 = input()
c2 = input()

if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
  print("YES")
else:
  print("NO")
a,b=map(int,input().split())
if a>b:
  print('>')
elif a==b:
  print('=')
else:
  print('<')

### FIXED CODE ###

c,d=map(str,input().split())
n=sorted([c,d])
a=n.index(c)
b=n.index(d)
if a>b:
  print('>')
elif a==b:
  print('=')
else:
  print('<')
n = int(input())

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

mod = 10**9 + 7

from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

x = lcm_list(a)

# print(x)

ans = 0
for i in range(n):
    ans += x/a[i]

print(int(ans)%mod)

### FIXED CODE ###

n = int(input())

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

mod = 10**9 + 7

from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

x = lcm_list(a)
# print(x)

ans = 0
for i in range(n):
    ans += int(x//a[i])

print(int(ans)%mod)