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

N = int(input())
A = list(map(int,input().split()))
se_ = set(A)
 
 
all = 0
for i in se_:
    all += A.count(i)*(A.count(i)-1)//2
    
 
for i in A:
    final=0
    final = all - A.count(i)+1
    print(final)

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int,input().split()))
se_ = Counter(A)
key = se_.keys()
 
 
all = 0
for i in key:
    all += se_[i]*(se_[i]-1)//2
    
 
for i in A:
    final=0
    final = all -se_[i]+1
    print(final)
### BUGGY CODE ###



def main():
    N = int(input())
    S = input()
    min_count = 30000
    for i in range(N):
        count = 0
        for loc, j in enumerate(S):
            if i == loc: 
                continue

            if loc > i:
                if j == "E":
                    count += 1
            if loc < i:
                if j == "W":
                    count += 1
        if count < min_count:
            min_count = count
    print(min_count)

if __name__ == "__main__":
    main()

### FIXED CODE ###



def main():
    N = int(input())
    S = input()

    l = [0]*N
    r = [0]*N
    for i in range(1, N):
        l[i] = l[i-1] + (S[i-1]=="W")
    for i in range(N-1)[::-1]:
        r[i] = r[i+1] + (S[i+1]=="E")

    
    ans = 10**6
    for a, b, in zip(l, r):
        ans = min(a+b, ans)
    print(ans)
    

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

import math

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

a=N//B

ans_list=[]

if a==0:
    x=N
    ans_list.append(math.floor(A*x/B)-A*math.floor(x/B))
    
else:
    for i in range(a+1):
        x=B*i-1
        ans_list.append(math.floor(A*x/B)-A*math.floor(x/B))
    ans_list.append(math.floor(A*N/B)-A*math.floor(N/B))

ans=max(ans_list)

print(ans)

### FIXED CODE ###

import math

def floor(A,B,t):
    return(math.floor(A*t/B)-A*math.floor(t/B))

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


ans=floor(A,B,min(B-1,N))

print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
p_list = list(map(int, input().split()))

cad_sum = 0
for i in range(n-k+1):
    cad_p_list = p_list[i:i+k]
    cad_sum_child_list = []
    for cad_p in cad_p_list:
        cad_sum_child = 0
        for num in range(1, cad_p+1):
            cad_sum_child += num
        cad_sum_child /= cad_p
        cad_sum_child_list.append(cad_sum_child)

    cad_sum_child = sum(cad_sum_child_list)
    if  cad_sum_child > cad_sum:
        cad_sum = cad_sum_child

print(cad_sum)

### FIXED CODE ###

n, k = map(int, input().split())
p_list = list(map(lambda x: (float(x) + 1) / 2, input().split()))

S_i = [0]
for i in range(n):
    S_i.append(S_i[i] + p_list[i])    

# print(S_i)
result_max = 0
for j in range(k, n+1):
    cad_max = S_i[j] - S_i[j-k]
    result_max = max(cad_max, result_max)

print(result_max)
### BUGGY CODE ###

n, k = list(map(int, input().split()))
s = str(input())

one = list(map(len, s.replace('0', ' ').split()))
zero = list(map(len, s.replace('1', ' ').split()))
if s[0] == '0':
    one.insert(0, 0)
if s[-1] == '0':
    one.append(0)
    
ans = 0
for i in range(len(zero)):
    length = sum(one[i:i+k+1]) + sum(zero[i:i+k])
    ans = max(ans, length)
    
    if i+k > len(zero):
        break
    
if s.count('1') == len(s):
    print(len(s))
else:
    print(ans)

### FIXED CODE ###

import numpy as np

n, k = list(map(int, input().split()))
s = str(input())

arr0 = np.array(list(map(len, s.split('1'))))
arr0 = arr0[arr0!=0]

arr1 = np.array(list(map(len, s.split('0'))))
arr1 = arr1[arr1!=0]


ans = 0

if s[0] == '0':
    for i in range(len(arr0)):
        
        if i == 0:
            length = arr0[i:i+k].sum() + arr1[i:i+k].sum()
        else:
            length = arr0[i:i+k].sum() + arr1[i-1:i+k].sum()
        ans = max(ans, length)
        
        if i+k > len(arr0):
            break
        
        
else:        
    for i in range(len(arr0)):
        
        
        length = arr0[i:i+k].sum() + arr1[i:i+k+1].sum()
        ans = max(ans, length)
        
        if i+k > len(arr0):
            break
        
        

if len(s) == s.count('1'):
    print(len(s))
else:
    print(ans)
### BUGGY CODE ###

N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
ans = [k for k, v in S.items() if v == max(S.values())]
ans.sort()

# 出力
for a in ans:
    print(a)

### FIXED CODE ###

N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
# ans = [k for k, v in S.items() if v == max(S.values())]
# ans.sort()
max_value = max(S.values())
ans = sorted([k for k, v in S.items() if v == max_value])

# 出力
for a in ans:
    print(a)
### BUGGY CODE ###

n, lim_w = map(int, input().split())
w, v = [], []

for _ in range(n):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

# dp[i][j] := i番目までの品物を見たとき, 重さの総和がj以下となるように選んだときの価値の総和の最大値
dp = [ [0]*(lim_w+1) for _ in range(n+1) ]

for i in range(n):
    for j in range(lim_w+1):
        if j < w[i]:
            dp[i+1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]] + v[i])

print(dp[n][lim_w])


### FIXED CODE ###

n, lim_w = map(int, input().split())
w, v = [], []

for _ in range(n):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

# dp[i][j] := i番目までの品物を見たとき, 重さの総和がj以下となるように選んだときの価値の総和の最大値
dp = [ [0]*(lim_w+1) for _ in range(n+1) ]

for i in range(n):
    for j in range(lim_w+1):
        if j < w[i]:
            dp[i+1][j] = dp[i][j]
        else:
            dp[i+1][j] = max(dp[i][j], dp[i][j-w[i]] + v[i])

print(dp[n][lim_w])
### BUGGY CODE ###

import collections
n = int(input())
s = input()
s_list = list(s)
ans_list = []

for i in range(n):
    before_list = s[:i]
    after_list = s[i+1:]
    cnt_before = collections.Counter(before_list)
    cnt_after = collections.Counter(after_list)
    ans_list.append(cnt_before['W'] + cnt_after['E'])

print(min(ans_list))

### FIXED CODE ###

n = int(input())
s = list(input())
cnt = 0
ans_list = [0]
e_cnt = 0

for i in range(1,n):
    if s[i-1] == "E" and s[i] == "E":
        cnt -= 1
        e_cnt += 1
    if s[i-1] == "E" and s[i] == "W":
        cnt -= 0
    if s[i-1] == "W" and s[i] == "E":
        cnt += 0
        e_cnt += 1
    if s[i-1] == "W" and s[i] == "W":
        cnt += 1
    ans_list.append(cnt)

print(min(ans_list) + e_cnt)
### BUGGY CODE ###

S = input()
T = input()
N = len(S)
pos_S = {c: [] for c in "abcdefghijklmnopqrstuvwxyz"}
[pos_S[S[i]].append(i) for i in range(N)]
pos_T = {c: [] for c in "abcdefghijklmnopqrstuvwxyz"}
[pos_T[T[i]].append(i) for i in range(N)]
if all(pos_S[S[i]] == pos_T[T[i]] for i in range(N)):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

from collections import Counter


S = Counter(input())
T = Counter(input())
if sorted(S.values()) == sorted(T.values()):
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

from collections import deque
from copy import deepcopy
N, M, K = map(int, input().split())
SNS = [[0 for _ in range(N+1)] for __ in range(N+1)]
for _ in range(M):
  a, b = map(int, input().split())
  SNS[a][b] = 1
  SNS[b][a] = 1
for _ in range(K):
  a, b = map(int, input().split())
  SNS[a][b] = -1
  SNS[b][a] = -1
Chains = []
seen = [False]*(N+1)
i = 1
while i <= N:
  if not seen[i]:
    seen[i] = True
    chain = deque()
    q = deque()
    j = 1
    while j <= N:
      if SNS[i][j] == 1:
        q.append(j)
      j += 1
    memo = [False]*(N+1)
    while q:
      j = q.pop()
      if not memo[j]:
        memo[j] = True
        seen[j] = True
        chain.append(j)
        k = 1
        while k <= N:
          if SNS[j][k] == 1:
            q.append(k)
          k += 1
    Chains.append(deepcopy(chain))
  i += 1
ans = [0] * (N+1)
for chain in Chains:
  l = len(chain)
  for hito in chain:
    n = 0
    for aite in chain:
      n += 0 if SNS[hito][aite] == 0 else 1
    ans[hito] = l - n -1
s = ""
i = 1
while i <= N:
  s += "%d "%ans[i]
  i += 1
print(s)

### FIXED CODE ###

from collections import deque
from copy import deepcopy

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()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M, K = map(int, input().split())
UF = UnionFind(N+1)
direct_connect = [0]*(N+1)
for _ in range(M):
  a, b = map(int, input().split())
  UF.union(a, b)
  direct_connect[a] += 1
  direct_connect[b] += 1
for _ in range(K):
  a, b = map(int, input().split())
  if UF.same(a, b):
    direct_connect[a] += 1
    direct_connect[b] += 1
ans = ""
for i in range(1, N+1):
  ans += "%d "%(UF.size(i)-direct_connect[i]-1)
print(ans)
### BUGGY CODE ###


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


for n in range(N):
    print(len(list(filter(lambda x: x == n + 1, arg))))
    arg = list(filter(lambda x: x != n + 1, arg))


### FIXED CODE ###

from collections import defaultdict, Counter

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

D = Counter(arg)

for n in range(N):
	print(D[n+1])
### BUGGY CODE ###

mod=10**9+7
def num2bi(x, k):
  #10進数xを2進数k桁(string)で出力
  out=format(x, '0'+str(k)+'b')
  return out

N=int(input())
A=list(map(int, input().split()))
ma=max(A)
keta=1
while ma>=2**keta:
  keta+=1
  
onekazu=[0 for i in range(keta)]
k=str(keta)
for i in range(N):
  temp=format(A[i], '0'+str(k)+'b')
  onekazu=[onekazu[j]+1 if temp[j]=='1' else onekazu[j] for j in range(keta)]
    
out=0
out=sum([(onekazu[i]*(N-onekazu[i])%mod)*(2**(keta-1-i))%mod for i in range(keta)])
out%=mod  
print(out)

### FIXED CODE ###

mod=10**9+7
def num2bi(x, k):
  #10進数xを2進数k桁(string)で出力
  out=format(x, '0'+str(k)+'b')
  return out

N=int(input())
A=list(map(int, input().split()))
ma=max(A)
keta=1
while ma>=2**keta:
  keta+=1
  
onekazu=[0 for i in range(keta)]
k=str(keta)
for i in range(N):
  temp=format(A[i], '0'+str(k)+'b')
  onekazu=[onekazu[j]+1 if temp[j]=='1' else onekazu[j] for j in range(keta)]
    
out=0
out=sum([(onekazu[i]*(N-onekazu[i])%mod)*(2**(keta-1-i))%mod for i in range(keta)])
out%=mod  
print(out)
### BUGGY CODE ###

from functools import lru_cache
from collections import defaultdict

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


@lru_cache(maxsize=None)
def combi(n):
    return n * (n-1) // 2


for a in A:
    d[a] += 1

ans = []
for i in range(N):
    tmp = d.copy()
    tmp[A[i]] -= 1
    ans = sum(list(map(combi, list(tmp.values()))))
    print(ans)

### FIXED CODE ###

from collections import defaultdict


def combi(n):
    if n < 2:
        return 0
    return n * (n-1) // 2


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

for a in A:
    d[a] += 1

whole = sum(list(map(combi, list(d.values()))))

diff = []
for i in range(N):
    diff.append(combi(d[A[i]]) - combi(d[A[i]] - 1))

for x in diff:
    print(whole - x)
### BUGGY CODE ###

import numpy as np
N, K = map(int,input().split())
h = list(map(int, input().split()))

dp = np.full(N, np.inf)
dp[0] = 0
for i in range(1,N):
  for j in range(1,K+1):
    if i >= j: dp[i] = min(dp[i],dp[i-j]+np.abs(h[i] - h[i-j]))
print(int(dp[-1]))

### FIXED CODE ###

N, K = map(int,input().split())
h = list(map(int, input().split()))

dp = [1e+09]*N
dp[0] = 0
for i in range(1,N):
  for j in range(1,K+1):
    if i >= j: dp[i] = min(dp[i],dp[i-j]+abs(h[i] - h[i-j]))
print(int(dp[-1]))
### BUGGY CODE ###

import bisect
N = int(input())
A = [int(input()) for i in [0]*N]

ls = [A[0]]
num = 1
for a in A[1:]:
	new = True 
	for i in range(num):
		if ls[i] < a:
			new = False
			ls[i] = a
			break
	if new:
		num += 1
		ls.append(a)

print(len(ls))






### FIXED CODE ###

import bisect
from collections import deque
N = int(input())
A = [int(input()) for i in [0]*N]


ls = deque([A[0]])
for a in A[1:]:
	ind = bisect.bisect_left(ls,a)
	if ind == 0:
		ls.appendleft(a)
	else:
		ls[ind-1] = a

print(len(ls))
### BUGGY CODE ###

N, M = [int(i) for i in input().strip().split(' ')]
A = [int(i) for i in input().strip().split(' ')]
for _ in range(M):
  b, c = [int(i) for i in input().strip().split(' ')]
  A.extend([c] * b)

A.sort()

print(sum(A[-N:]))

### FIXED CODE ###

from operator import itemgetter

N, M = [int(i) for i in input().strip().split(' ')]
A = [int(i) for i in input().strip().split(' ')]
A = sorted(A, reverse=True)

X = []
for _ in range(M):
  (b, c) = [int(i) for i in input().strip().split(' ')]
  X.append((b, c))

X = sorted(X, reverse=True, key=itemgetter(1))
if M < N:
  for _ in range(N - M):
    X.append((0, 0))

v = 0
ai = 0
xi = 0

while N > 0:
  a = A[ai]
  n, x = X[xi]
  if a > x:
    N -= 1
    ai += 1
    v += a
  else:
    if n > N:
      n = N
    N -= n
    xi += 1
    v += x * n

print(v)
### BUGGY CODE ###

N , Q = map(int,input().split())

D = [0]*Q
Input = []
length = [-1]*Q

for i in range(N):
    Input.append(list(map(int,input().split())))

dist = lambda A : A[2]
Input.sort(key=dist)

for i in range(Q):
    D[i] = int(input())

# i番目の人の座標を計算
for i in range(Q):
    for j in range(N):
        if(Input[j][1] <= D[i]): # 工事終了時刻 <= 出発時刻
            continue

        stopTime = Input[j][2] + D[i] # 出発時刻 + 距離/速度

        if(stopTime >= Input[j][0] - 0.5 and stopTime <= Input[j][1] - 0.5):
            length[i] = Input[j][2]
            break

for l in length:
    print(l)


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

N, Q = map(int, input().split())
INF = float('inf')

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append((S - X, 0, X))
    events.append((T - X, 1, X))

for _ in range(Q):
    events.append((int(input()), 2, 0))

events.sort()

cnt = defaultdict(int)
cnt[INF] += 1
que = [INF]

for t, flag, x in events:
    if flag == 0:
        if cnt[x] == 0:
            heappush(que, x)
        cnt[x] += 1
    elif flag == 1:
        cnt[x] -= 1
    else:
        while cnt[que[0]] == 0:
            heappop(que)
        print(que[0] if que[0] != INF else -1)
### BUGGY CODE ###

#!/usr/bin/env python3


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    visited = [0]
    now = 0
    for k in range(K):
        now = A[now] - 1
        if now in visited:
            start = visited.index(now)
            visited = visited[start:]
            shuki = k + 1 - start
            print(visited[(K - start) % shuki] + 1)
            return
        visited.append(now)
    print(visited[-1] + 1)



if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    visited = [0]
    visited_set = set()
    now = 0
    for k in range(K):
        now = A[now] - 1
        if now in visited_set:
            start = visited.index(now)
            shuki = k + 1 - start
            print(visited[start:][(K - start) % shuki] + 1)
            return
        visited.append(now)
        visited_set.add(now)
    print(visited[-1] + 1)



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

h, w = map(int, input().split())

mtx = [input() for _ in range(h)]

ret_mtx = [[[0] * 4 for _ in range(w)] for _ in range(h)]

# left 2 right
for i in range(h):
    for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx[i][j][0] = 1 if i == 0 else ret_mtx[i-1][j][0] + 1
            ret_mtx[i][j][1] = 1 if j == 0 else ret_mtx[i][j-1][1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx[-1-i][-1-j][2] = 1 if i == 0 else ret_mtx[-i][-1-j][2] + 1
            ret_mtx[-1-i][-1-j][3] = 1 if j == 0 else ret_mtx[-1-i][-j][3] + 1

ret = 0

for i in range(len(ret_mtx)):
    for j in range(len(ret_mtx[i])):
        tmp = sum(ret_mtx[i][j]) - 3
        ret = max(ret, tmp)

print(ret)


### FIXED CODE ###

h, w = map(int, input().split())

mtx = [input() for _ in range(h)]

ret_mtx1 = [[0] * w for _ in range(h)]
ret_mtx2 = [[0] * w for _ in range(h)]
ret_mtx3 = [[0] * w for _ in range(h)]
ret_mtx4 = [[0] * w for _ in range(h)]

# left 2 right
for i in range(h):
    for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1

ret = 0

for i in range(h):
    for j in range(w):
        tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3
        ret = max(ret, tmp)

print(ret)
### BUGGY CODE ###

# coding:UTF-8

N, K = map(int, input().split())
health = list(map(int, input().split()))

count = 0

for k in range(0, K):
    health[health.index(max(health))] = 0

print(sum(health))


### FIXED CODE ###

# coding:UTF-8

N, K = map(int, input().split())
health = list(map(int, input().split()))

count = 0

health = sorted(health,reverse=True)

print(sum(health[K:]))
### BUGGY CODE ###

def main():
  inf = 10 ** 20
  a,b,q = map(int, input().split())
  s = [None] * (a + 3)
  s[0:2] = [-inf,-inf]
  s[-1] = inf
  t = [None] * (b + 3)
  t[0:2] = [-inf,-inf]
  t[-1] = inf
  for i in range(a):
      s[i+2] = int(input())
  for i in range(b):
      t[i+2] = int(input())

  from bisect import bisect_right


  for _ in range(q):
    ans = inf
    x = int(input())
    sr = bisect_right(s, x)
    tr = bisect_right(t, x)    
    for si in (sr, sr-1):
      for ti in (tr, tr-1):
        ans = min(ans, abs(x-s[si]) + abs(s[si]-t[ti]), abs(x-t[ti]) + abs(s[si]-t[ti]))
    print(ans)
  
if __name__ == "__main__":
  main()


### FIXED CODE ###

#A

"""
s = input().split("/")
if int(s[1]) <= 4:
    print("Heisei")
else:
    print("TBD")
"""
#B
"""
n = int(input())
ans = 0
for i in range(n):
    a = input().split()
    if a[1] == "JPY":
        ans += int(a[0])
    else:
        ans +=  float(a[0]) * 380000
print(ans)
"""

#C
"""
n, a, b, c = map(int, input().split())
abc = [a,b,c]
x = [int(input()) for i in range(n)]
x.sort()
ans = []
flg = 0
for i in x:
    if i in abc:
        ans.append(i)
        flg = 1
if flg:
    for i in ans:
        abc.remove(i)
        x.remove(i)

"""
#D

a, b, q = map(int, input().split())
s = [int(input()) for i in range(a)]
t = [int(input()) for i in range(b)]
s.sort()
t.sort()

import bisect


for i in range(q):
    x = int(input())
    s_l = bisect.bisect_left(s, x) - 1
    t_l = bisect.bisect_left(t, x) - 1
    s_r = s_l + 1
    t_r = t_l + 1
    if s_l == -1:
        s_l = 0
    if t_l == -1:
        t_l = 0
    if s_l == a :
        s_l = a - 1
        s_r = a - 1
    if s_r == a:
        s_r = a - 1
    if t_l == b:
        t_l = b - 1
        t_r = b - 1
    if t_r == b:
        t_r = b - 1
    ans = min(abs(t[t_l] - s[s_r]) + min(abs(t[t_l] - x), abs(s[s_r] - x)),
    abs(s[s_l] - t[t_r]) + min(abs(s[s_l] - x), abs(t[t_r] - x)),
    abs(s[s_l] - t[t_l]) + min(abs(s[s_l] - x), abs(t[t_l] - x)),
    abs(s[s_r] - t[t_r]) + min(abs(s[s_r] - x), abs(t[t_r] - x)),
    )
    
    print(ans)
### BUGGY CODE ###

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

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

t = 0
s = 1
u = 0
k_k = k
temp = []
while k != n+1:
  for i in range(t, k):
    alpha = a[i]
    s = s * alpha
  temp.append(s)
  k = k + 1
  s = 1
  t = t+1
  if u != 0:
    t_s = temp[u-1]
    t_t = temp[u]
    if t_s < t_t:
      print("Yes")
      u = u + 1
    else:
      print("No")
      u = u + 1
  else:    
    u = u + 1    





### FIXED CODE ###

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

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

for i in range(k, n):
  if a[i-k] < a[i]:
    print("Yes")
  else:
    print("No")
### BUGGY CODE ###

import collections
from functools import reduce

S = input()
Q = int(input())

deque = collections.deque(S)

is_reverse = False
for _ in range(Q):
    query = input().split()
    if query[0] == '1':
        is_reverse = not is_reverse
    else:
        if (query[1] == '1' and not is_reverse) or (query[1] =='2' and is_reverse):
            deque.appendleft(query[2])
        else:
            deque.append(query[2])
res = ""
if not is_reverse:
    for s in deque:
        res += s
else:
    for s in deque:
        res = s+res
print(res)


### FIXED CODE ###

import collections
from functools import reduce

S = input()
Q = int(input())

deque = collections.deque(S)

is_reverse = False
for _ in range(Q):
    query = input().split()
    if query[0] == '1':
        is_reverse = not is_reverse
    else:
        if (query[1] == '1' and not is_reverse) or (query[1] =='2' and is_reverse):
            deque.appendleft(query[2])
        else:
            deque.append(query[2])
if is_reverse:
    deque.reverse()

res = list(deque)

print("".join(res))
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n = int(input())
a = (input().split())
b = 1

while True:
    for i in range(n-1):

        if int(a[i]) % 2 == 1:
            break

        a[i] = int(a[i]) / 2
        b +=1


print(b)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
b = 0
c = 2
f = 0


while True:
    for i in a:
        if i % c > 0:
            f = f +1
            break
    if f == 1:
        break

    b = b + 1
    c = c * 2



print(b)
### BUGGY CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
use = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [[0] * 10 for i in range(n+1)]
for i in range(1,n+1):
    kouho = []
    for j in a:
        if i - use[j] >= 0:
            if dp[i-use[j]] == [0] * 10 and i - use[j] != 0: # マッチの数が合わない場合
                continue #何もしない
            else:
                copy = dp[i-use[j]][:]
                copy[j] += 1
                kouho.append(copy)
    if kouho == []: #空の場合
        continue #何もしない
    else:
        usearray = []
        accnum = "0"
        for array in kouho:
            tmpnum = ""
            for k in range(9,0,-1):
                tmpnum += (str(k) * array[k])
            if int(tmpnum) > int(accnum):
                usearray = array
                accnum = tmpnum
        dp[i] = usearray
ans = ""
for i in range(9,0,-1):
    ans += (str(i) * dp[n][i])
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
use = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = [[0] * 10 for i in range(n+1)]
for i in range(1,n+1):
    for j in a:
        if i - use[j] >= 0:
            if dp[i-use[j]] == [0] * 10 and i - use[j] != 0: # マッチの数が合わない場合
                continue #何もしない
            else:
                if sum(dp[i-use[j]])+1 >= sum(dp[i]):
                    copy = dp[i-use[j]][:]
                    copy[j] += 1
                    dp[i] = copy
ans = ""
for i in range(9,0,-1):
    ans += (str(i) * dp[n][i])
print(ans)