peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    X = int(input())
    a = math.gcd(X, 360)
    a = X * 360 // a
    print(a // X)


if __name__ == "__main__":
    main()
# Judge status: Accepted
A,B,C = [int(i) for i in input().split()]
if A <= C and C <= B:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a=int(input())
n=2*(a//11)+(a%11//7)+1
if a%11==0:
  n-=1
print(n)
# Judge status: Accepted
# coding: utf-8

num = int(input())
str = input().split()
table = list(str)
table5 = [int(i) for i in table]
count = 0
table2 = sorted(table5)
table3 = [int(i) for i in table2]
for i in range(num):
    if table5[i] == table3[i]:
        continue
    else:
        count += 1

if count == 2 or count == 0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
L, R, d = [int(s) for s in input().split()]

print(R//d - L//d)
# Judge status: Accepted
s = input()
n = len(s)
dp = [ [0,0] for i in range(n) ]
dp[0][0] = ord(s[0])-ord('0')
dp[0][1] = 11-(ord(s[0])-ord('0'))
for i in range(n-1):
  d = ord(s[i+1])-ord('0')
  dp[i+1][0] = min(dp[i][0], dp[i][1]) + d
  dp[i+1][1] = min(dp[i][0]+11-d, dp[i][1]+9-d)
print(min(dp[n-1][0],dp[n-1][1]))
# Judge status: Accepted
N = list(map(int,input()))
for i in range(3):
    if(N[i]== 7):
        print('Yes')
        break
    elif(i == 2 ):
        print('No')
# Judge status: Wrong Answer
#3

n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))
list_score = []

for i in range(n):
    if i < k - 1:
        continue
    list_score.append(sum(list_a[i-2:i+1])/k)
# print(list_score)

score_before = list_score[0]
for score in list_score[1:]:
    if score_before < score:
        print('Yes')
        score_before = score
        continue
    print('No')
    score_before = score
# Judge status: Accepted
A,B,C = map(int,input().split())

ans = min(B//A,C)
print(ans)
# Judge status: Accepted
n = int(input())
H = list(map(int,input().split()))
ans = "Yes"
 
for i in range(n-1):
    if H[i] < H[i+1]:
        H[i+1] -= 1
    
    if H[i] > H[i+1]:
        ans = "No"
        break
        
print(ans)
# Judge status: Accepted
n,m = map(int,input().split())
ans = 0
if 2*n <= m:
    ans += n
    m -= 2*n
    if m >= 4:
        ans += m//4
else:
    ans += m//2
print(ans)
# Judge status: Wrong Answer
N=input()
count=0
more_count=0
for n in N[::-1]:
  d=int(n)
  if d<=5:
    count+=d
    if more_count>=2:
      count-=more_count
      more_count=0
  else:
    count+=(10-d)+1
    more_count+=1
if more_count>=2:
  count-=more_count
print(count)
# Judge status: Wrong Answer
n = input()

mask = 10 ** (len(n)-1)
n = int(n)

if n //mask == 1:
    print(10)
else:
    print(n//mask + n%10)
# Judge status: Wrong Answer
n=int(input())
a=0
for i in range(7):
    if 2**i > n:
        break
print(2**(i-1))
# Judge status: Accepted
N=int(input())
alpha='abcdefghijklmnopqrstuvwxyz'
 
ans=''
while 26<N:
    s=(N-1)%26
    ans=alpha[s]+ans
    N=int(N-1)//26
ans=alpha[N-1]+ans
print(ans)
# Judge status: Accepted
N = int(input())
D_list = []
for _ in range(N):
    D1, D2 = map(int, input().split())
    D_list.append([D1, D2])

sequence_doublet = 0
for D in D_list:
    if D[0] == D[1]:
        sequence_doublet += 1
    else:
        sequence_doublet = 0
    
    if sequence_doublet == 3:
        break

if sequence_doublet == 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a, b = map(int, input().split())
h = 0
d = b - a 

for i in range(1, 999):
  h += i
  if i == d:
    print(h - b)
    exit()
# Judge status: Accepted
from collections import deque

S=deque(str((input())))
Q=int(input())
t=0
for _ in range(Q):
    T=list(map(str,input().split()))
    if T[0]=="1":
        t+=1
    else:
        if (T[1]=="1" and t%2 == 0) or (T[1]=="2" and t%2 != 0):
            S.appendleft(T[2])
        else:
            S.append(T[2])


if t%2 != 0:
    S.reverse()

print("".join(S))
# Judge status: Accepted
def count(n, b):
  res = 0
  while n:
    res += n % b
    n //= b
  return res

def main():
  res = float('inf')
  for i in range(n + 1):
    res = min(res, count(i, 6) + count(n - i, 9))
  print(res)
 
if __name__ ==  '__main__':
  n = int(input())
  main()
# Judge status: Accepted
N, K = map(int, input().split())
S = list(input())
r_cnt = 0
answer = 0
before = S[0]
for s in S:
  if s == before:
    answer += 1
  else:
    r_cnt += 1
    before = s
answer -= 1
if r_cnt%2 == 0:
  print(answer+min(r_cnt//2, K)*2)
elif r_cnt//2 >= K:
  print(answer+K*2)
else:
  print(answer+(r_cnt//2+1)*2-1)
# Judge status: Accepted
x,y=map(int,input().split())
cnt=0
while x<=y:
  x=x*2
  cnt+=1
print(cnt)
# Judge status: Wrong Answer
a,b = input().split()
if a >= b:
  print("safe")
else:
  print("unsafe")
# Judge status: Accepted
input()
A = list(map(int, input().split()))
count = 0

while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
l = [False]*8
ov = 0

for i in range(n):
    if a[i] < 3200:
        l[a[i]//400] = True
    else:
        ov += 1

ans = l.count(True)

print(max(ans, 1), ans + ov)
# Judge status: Accepted
A = list(input())
B = list(input())
C = list(input())

A.append("#")
B.append("#")
C.append("#")
game = {
  "A" : A,
  "B" : B,
  "C" : C
}
turn = "A"
finished = False

while not finished:
  next_turn = game[turn].pop(0)
  if next_turn == "#":
    print(turn)
    finished = True
  else:
    turn = next_turn.upper()
# Judge status: Accepted
a,b,c = input().split()
print(a[0]+b[0]+c[0])
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
from bisect import *
mod = 10**9+7

N = int(input())
XL = [list(map(int, input().split())) for i in range(N)]
A = [(X+L, X-L) for X, L in XL]
A.sort()
cnt, last = 0, A[0][0]
for s, t in A[1:]:
    if t < last:
        cnt += 1
    else:
        last = s
print(N-cnt)
# Judge status: Accepted
n = int(input())
from collections import defaultdict
s = defaultdict(int)
for i in range(n):
    si = input()
    s[si] += 1

m = int(input())
for i in range(m):
    ti = input()
    s[ti] -= 1

print(max(0,max(s.values())))
# Judge status: Wrong Answer
N,L = map(int,input().split())
L = sorted(input().split())

print(''.join(L))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
A.sort()
print(sum(A[N:2*N]))
# Judge status: Accepted
w,h,x,y=map(int,input().split())
if x==w/2 and y==h/2:
  print(w*h/2,1)
else:
  print(w*h/2,0)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
 
if abs(a - c) <= d or abs(b - a) <= d and abs(c - b) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(n-1):
    if a[i+1] > a[i]:
        stock = money // a[i]
        money += (a[i+1] - a[i]) * stock
print(money)
# Judge status: Accepted
n = int(input())
x = [list(map(int, input().split())) for i in range(n)]

y = [[0 for j in i] for i in x]


for i in range(len(x)):
    if i - 1 < 0:
        y[i] = [k for k in x[i]]    
        continue

    for j in range(len(x[i])):
        x_1 = max([y[i - 1][k] for k in range(len(x[i - 1])) if k != j])
        y[i][j] = x[i][j] + x_1

print(max(y[n - 1]))
# Judge status: Accepted
n = int(input())
hlst = list(map(int, input().split()))
bef = 0
for h in hlst:
  if h < bef:
    print("No")
    break
  elif h == bef:
    bef = h
  else:
    bef = h - 1
else:
  print("Yes")
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n):
  if i+1 != p[i]:
    count += 1

if count <= 2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
p = set()
for i in a:
    if i in p:
        print('NO')
        exit()
    p.add(i)
print('YES')
# Judge status: Accepted
x = int(input())

if x == 5 or x == 3 or x == 7:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

a.sort()

b = 0
c = sum(a)

ans = 10 ** 9
for i in range(n-1):
    b += a[i]
    c -= a[i] 
    ans = min(ans, abs(b - c))

print(ans)
# Judge status: Accepted
n = int(input())
a=list(map(int,input().split()))
cnt,cnt2,cnt4=0,0,0
for val in a:
    if val%4==0:
        cnt4+=1
    elif val%2==0:
        cnt2+=1
    else:
        cnt+=1
if cnt2==0:
    if cnt4>=cnt-1: print("Yes")
    else: print("No")
else:
    if cnt4>=cnt: print("Yes")
    else: print("No")
# Judge status: Accepted
A=input()
B=input()
if A[0]==B[2] and A[1]==B[1] and A[2]==B[0]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
w, a, b = map(int, input().split())
if (a <= b <= a+w) or (a <= b+w <= a+w):
    print(0)
elif (a < b) and (a+w < b):
    print(b - a - w)
else:
    print(a - b - w)
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))
D = [1]
seen = [0]*n
seen[0] = 1
now = 0
while True:
    now = A[now] - 1
    D.append(now+1)
    if seen[now]:
        break
    seen[now] = 1
f = D.index(D[-1])
if k < f:
    print(D[k])
else:
    cycle = len(D) - f - 1
    k -= f
    print(D[f + k%(cycle)])
# Judge status: Accepted
n = int(input())

robots = []

for i in range(n):
    x,l = map(int, input().split())
    robots.append((x+l, x-l))

INF = 1e10
last = -INF
    
robots.sort()

ans = 0
for (r, l) in robots:
    if l < last:continue
    ans += 1
    last = r

print(ans)
# Judge status: Accepted
A,B,C=map(int,input().split(' '))
rem=abs(A-B)
print(abs(rem-C)) if rem<C else print(0)
# Judge status: Wrong Answer
n=int(input())
print((n//2)*(n+1)//2)
# Judge status: Accepted
n,k=map(int,input().split());print(sum(sorted(map(int,input().split()))[:k]))
# Judge status: Accepted
A = list(map(int,input().split()))
print(len(set(A)))
# Judge status: Accepted
# 090_B
a,b=map(int,input().split())
print(sum([str(i)==str(i)[::-1] for i in range(a,b+1)]))
# Judge status: Accepted
import sys
n, m = map(int, input().split())
ball = [1 for i in range(n+1)]
box = [0 for i in range(n+1)]
box[1] = 1
for a in sys.stdin.readlines():
    x, y = map(int, a.split())
    ball[x] -= 1
    ball[y] += 1
    if box[y] == 0 and box[x]:
        box[y] = 1
    if box[x] and ball[x] == 0:
        box[x] = 0

print(sum(box))
# Judge status: Wrong Answer
import numpy as np

N = int(input())

A = list(map(int, input().split()))
A = np.array(A)

print(np.sum(np.abs(A)))
# Judge status: Accepted
n = int(input())
jobs = []
for i in range(n):
    s = list(map(int,input().split()))
    jobs.append(s)
    

end_jobs = sorted(jobs,key=lambda x:x[1])

cnt = 0
for i in end_jobs:
    cnt += i[0]
    if cnt > i[1]:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
k = int(input())
s = input()

if(len(s) <= k):
    print(s)
else:
    for i in range(k):
        print(s[i],end="")
    print("...")
# Judge status: Accepted

P, Q, R = map(int, input().split())

print(min(P+Q, Q+R, P+R))
# Judge status: Accepted
n,m=map(int,input().split())
k=[]
zisyo={}

for i in range(n):
    k.append(list(map(int,input().split())))

for i in range(n):
    for j in range(1,k[i][0]+1):
        if  str(k[i][j]) in zisyo:
            zisyo[str(k[i][j])]+=1
        else:
            zisyo[str(k[i][j])]=1

count=0

for key,val in zisyo.items():
    if val==n:
        count+=1
print(count)
# Judge status: Accepted
N = int(input())
x, y, z = 0, 0, 0
for _ in range(N):
    a, b, c = map(int, input().split())
    x, y, z = max(y, z) + a, max(z, x) + b, max(x, y) + c
print(max(x, y, z))
# Judge status: Accepted
print(int((s:=input())[:-4])*int(s[-4]+s[-2:])//100)
# Judge status: Accepted
a,b,c=map(int,input().split())
if c-(a+b)>=0:
  if 4*a*b<(c-(a+b))**2:
    print('Yes')
  else:
    print('No')
else:
  print('No')
# Judge status: Wrong Answer
import sys 
from math import gcd
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
mod = 10 ** 9 + 7
N = int(readline())
A = list(map(int,readline().split()))
@jit(cache=True)
def lcm(N,a):
    x = a[0]
    for i in range(1, N):
        x = (x * a[i]) // gcd(x, a[i])
    ans = 0 
    for i in range(N):
        ans += x // a[i] % mod
    return ans%mod
A = np.array(A,np.int64)
ans = lcm(N,A)
print(ans)
# Judge status: Accepted
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
h=abs(A-(T-(H[0]*0.006)))
m=1
for i in range(1,N):
    if h>abs(A-(T-(H[i]*0.006))):
        h=abs(A-(T-(H[i]*0.006)))
        m=i+1
print(m)
# Judge status: Accepted
def MI():return map(int,input().split())
def LI():return list(MI())

from collections import Counter

n=int(input())
a=LI()
c=Counter(a)

# print(c)
M=0
for i,j in c.items():
    M+=(j)*(j-1)//2
# print(M)
for i in a:
    t=c[i]
    d=(t-1)
    print(M-d)
# Judge status: Accepted
n,m = map(int,input().split())
a = [list(input()) for i in range(n)]
b = [list(input()) for i in range(m)]
for i in range(n-m+1):
    for j in range(n-m+1):
        for k in range(m):
            if a[i+k][j:j+m] != b[k]:
                break
        else:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N = int(input())

    print(int(N**0.5)**2)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
a,b,c=map(int,input().split())
if a+b==c or a+c==b or a==b+c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
from itertools import combinations_with_replacement

n,m,q=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(q)]

A=list(combinations_with_replacement(range(1,m+1),n))

res=0

for i in range(len(A)):
    tmp=0
    for j in range(len(l)):
        if A[i][l[j][1]-1]-A[i][l[j][0]-1]==l[j][2]:
            tmp+=l[j][3]

    res=max(res, tmp)

print(res)
# Judge status: Accepted
N, M = input().split()
N, M = [int(N), int(M)]
a = list(map(int, input().split()))
x = 0
for i in range(M):
    x += a[i]

if x > N:
    print(-1)
else:
    print(N - x)
# Judge status: Accepted
n, m = map(int, input().split())

r = [False] * n
r[0] = True
l = [1] * n

for _ in range(m):
    x, y = map(int, input().split())
    l[x - 1] -= 1
    l[y - 1] += 1
    if r[x - 1]:
        r[y - 1] = True
    if l[x - 1] == 0:
        r[x - 1] = False

c = 0
for i in range(n):
    if r[i] == True and l[i] > 0:
        c += 1

print(c)
# Judge status: Accepted
import sys,math,copy,queue,itertools,bisect,collections,heapq
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

N,M = LI()
p = []
i = 1
for j in range(M,0,-2):
    p.append([i,i+j])
    i += 1
i = M+2
for j in range(M-1,0,-2):
    p.append([i,i+j])
    i += 1
for ans in p:
    print (*ans)
# Judge status: Accepted
n,x = map(int,input().split())
ls = list(map(int, input().split()))
d = 0
ans = 0
for l in ls:
  if d <= x:
    ans += 1
  d += l
if d <= x:
  ans += 1
  
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    ans+=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
list1 = [int(x) for x in input().split()]


list2 = list(reversed(sorted(list1)))


m = list2[0]


ans = []

for i in range(1, len(list2)):
  if list2[i] == m:
    ans.append(m)
  if len(ans) == 2:
    break
  m = list2[i]


if len(ans) == 2:
  print(ans[0] * ans[1])
else:
  print(0)
# Judge status: Wrong Answer
import math
l = int(input())
x = math.floor(l/3)

if l%3 == 0:
  ans = x**3
elif l%3 == 1:
  ans = x*x*(x+1)
else:
  ans = x*(x+1)*(x+1)

print(str(ans))
# Judge status: Accepted
def solve(h):
    dp = [0, abs(h[0]-h[1])]
    for i in range(2, len(h)):
        one = dp[i-1] + abs(h[i-1]-h[i])
        two = dp[i-2] + abs(h[i-2]-h[i])
        dp.append(min(one, two))
    return dp[-1]



if __name__ == "__main__":
    n = int(input())
    h = [int(x) for x in input().split()]
    print(solve(h))
# Judge status: Accepted
from sys import stdin, setrecursionlimit


def cmb(n, r, mod=10 ** 9 + 7):
    r = min(r, n - r)
    x = y = 1
    for i in range(r):
        x *= n - i
        x %= mod
        y *= i + 1
        y %= mod
    return x * pow(y, mod - 2, mod) % mod


def main():
    input = stdin.buffer.readline
    n, a, b = map(int, input().split())
    mod = 10 ** 9 + 7

    print((pow(2, n, mod) - 1 - cmb(n, a, mod) - cmb(n, b, mod)) % mod)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Accepted
N = int(input())
A = []
B = []
for i in range (0,N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)
    
A = sorted(A)
B = sorted(B)

from statistics import median

if N%2 ==1:
	print(median(B)-median(A)+1)
else:
	print(int((median(B)-median(A))*2+1))
# Judge status: Accepted
n=int(input())
lists=[]
for i  in range(n):
    x,y=map(int,input().split())
    lists.append((x-y,x+y))
lists=sorted(lists,key=lambda x:(x[1]))
A=1
P=lists[0]
for i in range(1,len(lists)):
    if lists[i][0]>=P[1]:
        A+=1
        P=lists[i]
print(A)
# Judge status: Accepted
x=int(input())
y=x//200
print(10-y)
# Judge status: Wrong Answer
S = ["ABC", "ARC"]
if S == S[0]:
  print(S[1])
else:
  print(S[0])
# Judge status: Accepted
N = input()
p = [int(x)-1 for x in raw_input().split()]

ans = 0
for i in range(N-1):
  if p[i]==i:
    p[i],p[i+1] = p[i+1],p[i]
    ans += 1
if p[-1]==N-1:
  ans += 1
print ans
# Judge status: Accepted
n,k=map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))
# Judge status: Wrong Answer
n,m=map(int,input().split())

yakusuu=[]
import math
for i in range(1,int(math.sqrt(m)+1)):
  if m%i==0:
    yakusuu.append(i)
    yakusuu.append(m//i)
yakusuu.sort()
for num in yakusuu:
  if num>=n:
    print(num)
    exit()
# Judge status: Accepted
S=str(input())
print(S[0:3])
# Judge status: Accepted
a,b,c = map(int, input().split())
if a+b < c:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
n, l = map(int, input().split())
s = [input() for _ in range(n)]

s.sort()
print(''.join(s))
# Judge status: Accepted
S = int(input())
count = 0
for i in range(1, S+1):
    if len(str(i)) % 2 == 1:
        count += 1
print(count)
# Judge status: Accepted
n=int(input())
a=[]
b=[]
for _ in range(n):
  x,y=map(int,input().split())
  a+=(x+y),
  b+=(x-y),
c=max(a)-min(a)
d=max(b)-min(b)
ans=max(c,d,-c,-d)
print(ans)
# Judge status: Accepted
n, *b = map(int, open(0).read().split())
a = [0]*n
b.append(float("inf"))
for i in range(n):
  a[i] = min(b[i-1], b[i])
print(sum(a))
# Judge status: Accepted
#!/usr/bin/env python3
# from typing import *
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def solve(A, B):
    print(A*B)


def main():
    A, B = map(int, input().split())
    solve(A, B)

if __name__ == '__main__':
    main()
'''
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh test_py.sh
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh etest_py.sh
cd ~/Desktop/Programming/AtCoder/contest/abc169/abc169_a && sh submit_py.sh
'''
# Judge status: Accepted
X, Y , A, B, C = list(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)

P = p[0:X]
Q = q[0:Y]
R = r[0:X+Y]

S = P + Q + R

S.sort(reverse = True)

ans = sum(S[0:X+Y])

print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print("a" if b>=a else "b")
# Judge status: Accepted
N = int(input())
s = input()
t = input()
for i in range(N):
    ok = 1
    for j in range(N-i):
        if s[i+j] != t[j]:
            ok = 0
            break
    if ok == 1:
        ans = N+i
        break
if ok == 0:
    ans = 2*N
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
s, c = map(int, input().split())

if s * 2 <= c:
    print((s*2+c)//4)
else:
    print(c // 2)
# Judge status: Accepted

def resolve():
    N,K =map(int,input().split())
    A = list(map(int,input().split()))

    for i in range(K,N):
        if A[i] > A[i-K]:
            print('Yes')
        else:
            print('No')
resolve()
# Judge status: Accepted
# B - Making Triangle

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

count = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] == l[j] or l[j] == l[k] or l[k] == l[i]:
                continue
            a, b, c = sorted((l[i], l[j], l[k]))
            if a + b > c:
                count += 1
print(count)
# Judge status: Accepted
A,B,K = map(int,input().split())
ans = []
for i in range(1,min(A,B)+1):
    if A%i == 0 and B%i == 0:
        ans.append(i)
ans.sort(reverse=True)
print(ans[K-1])
# Judge status: Accepted
s = input()
print(s[:3] + "8" + s[4:])
# Judge status: Accepted
S = list(str(input()))
T = list(str(input()))

for i in range(len(S)):
    S.append(S[0])
    del S[0]
    if S == T:
        print("Yes")
        exit()

print("No")
# Judge status: Accepted
n, x, t = map(int, input().split())
total = int(n / x) * t
total += t if (n % x) > 0 else 0
print(total)
# Judge status: Accepted
x,y = map(int,input().split())
print(x+y//2)
# Judge status: Wrong Answer
L=list(input())
print("No" if L.count("A")==0 else "Yes")
# Judge status: Accepted
# coding: utf-8

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

M=max(A)
l=0
for i in range(n):
    if abs(M/2-A[i])<abs(M/2-l):
        l=A[i]
        
print(M,l)
# Judge status: Wrong Answer
n = int(input())

print(round(n/2))
# Judge status: Accepted
from collections import defaultdict
N = int(input())
A = [int(a) for a in input().split()]
d = defaultdict(int)
for a in A:
    d[a] += 1
Q = int(input())
S = sum(A)
ans = []
for _ in range(Q):
    B, C = map(int, input().split())
    S += d[B] * (C - B)
    ans.append(S)
    d[C] += d[B]
    d[B] = 0
for a in ans:
    print(a)
# Judge status: Accepted
x=int(input())
if x==3 or x==5 or x==7:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
N = int(input())

A = [list(map(int,input().split())) for i in range(2)]

# 各マスの最大値を保持するマスを作成
Am = [[0 for j in range(N)] for i in range(2)]
# ループ内で処理するのめんどう
Am[0][0] = A[0][0]
Am[1][0] = A[0][0] + A[1][0]

# 1段目
for i in range(N):
  if i > 0:
    Am[0][i] = A[0][i] + Am[0][i-1]
# 2段目
for i in range(N):
  if i > 0:
    Am[1][i] = A[1][i] + max( Am[0][i] , Am[1][i - 1])

print(Am)
# Judge status: Accepted
s = input()
t = input()

ss = "".join(sorted(s))
ts = "".join(sorted(t,reverse=True))

if ss<ts:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n=int(input())
if n<10:
  print(n)
if 10<=n<100:
  print(9)
elif 100 <= n < 1000:
  print(n-90)
elif 1000 <= n < 10000:
  print(910)
elif 10000 <= n < 100000:
  print(n-9090)
elif n==100000:
  print(90909)
# Judge status: Wrong Answer
n,m = map(int,input().split())

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

print(sum(a[:3]))
# Judge status: Wrong Answer
import numpy as np
import bisect
n = int(input())
A = list(map(int,input().split()))

cs = np.cumsum(A).tolist()
mid = sum(A)//2
idx = bisect.bisect_left(cs, mid)

ans = float('inf')
for i in range(max(0, idx-1), idx+1):
    x = A[:i]
    y = A[i:]
    sum_x = sum(x)
    sum_y = sum(y)
    ans = min(ans, abs(sum_x - sum_y))
print(ans)
# Judge status: Accepted
import math

a,b,h,m = map(float, input().split())
theta1 = (h*60 + m)/2
theta2 = m*6
theta = theta1 - theta2
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(theta)))
print(c)
# Judge status: Wrong Answer
X = int(input())
m = 100
for n in range(5000):
  m = int(m*1.01)
  if m > X:
    print(n)
    break
# Judge status: Accepted
a,b,c,d,e,f=[int(input()) for i in range(6)]
print("Yay!" if abs(a-e)<=f else ":(")