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

#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def S(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

alphabets = "abcdefghijklmnopqrstuvwxyz"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N, K = LI()
    A = LI()
    cum = [1] * (N + 1)
    val = []

    for i in range(N):
        cum[i+1] = cum[i] * A[i]

    for i in range(K, N+1):
        val.append(cum[i] // cum[i - K])

    for i in range(N-K):
        print("Yes" if val[i+1] > val[i] else "No")


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools, bisect
import math, fractions
import sys, copy

def L(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline().rstrip())
def S(): return list(sys.stdin.readline().rstrip())
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def LIR1(n): return [LI1() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
def LR(n): return [L() for _ in range(n)]

alphabets = "abcdefghijklmnopqrstuvwxyz"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    N, K = LI()
    A = LI()

    for i in range(K, N):
        print("Yes" if A[i] > A[i - K] else "No")


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

s = input()
s = s[::-1]

l = [0 for i in range(2019)]
n = len(s)
l[0] = 1
prev = 0
digit = 1
for c in s:
    t = (int(c) * digit + prev) % 2019
    l[t] += 1
    digit = digit * 10
    prev = t

res = 0
for i in l:
    res += i * (i-1) // 2

print(res)

### FIXED CODE ###

s = input()
s = s[::-1]

l = [0 for i in range(2019)]
n = len(s)
l[0] = 1
prev = 0
digit = 1
for c in s:
    t = (int(c) * digit + prev) % 2019
    l[t] += 1
    digit = (digit * 10) % 2019
    prev = t

res = 0
for i in l:
    res += i * (i-1) // 2

print(res)
### BUGGY CODE ###

N,K,Q = map(int,input().split())
A = [int(input()) for _ in range(Q)]
data = [K]*N
for q in range(Q):
  data = list(map(lambda x: x - 1, data))
  data[A[q]-1] += 1
for i in range(N):
  if data[i] > 0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

from collections import Counter
N,K,Q = map(int,input().split())
A = [int(input()) for _ in range(Q)]
data = [K-Q]*N
C = Counter(A)
for i,j in C.items():
  data[i-1] += j
for i in range(N):
  if data[i] > 0:
    print("Yes")
  else:
    print("No")
### BUGGY CODE ###

from operator import mul
from functools import reduce

# A, B = tuple(map(int, input().split()))
N = int(input())
list_A = list(map(int, input().split()))
threshold = 10 ** 18

if 0 in list_A:
    print(0)
    exit()
if max(list_A) > threshold:
    print(-1)
    exit()

result = reduce(mul, list_A)

if result > threshold:
    print(-1)
else:
    print(result)


### FIXED CODE ###

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

if 0 in list_A:
    print(0)
    exit()

result = 1
for a in list_A:
    result *= a
    if result > 1e18:
        print(-1)
        exit()

print(result)
### BUGGY CODE ###

import numpy as np

D=int(input())
c=np.array(list(map(int,input().split())))
s=[list(map(int,input().split())) for _ in range(D)]
t=[np.random.randint(1,27) for _ in range(D)]

MAX=0
for _ in range(5000):
    d=np.random.randint(1,D+1)
    q=np.random.randint(1,27)
    last=np.array([0]*26)
    v=0
    for i in range(1,D+1):
        if i==d:
            v+=s[d-1][q-1]
            last[q-1]=d
            v-=np.dot(c,d-last)
            continue
        v+=s[i-1][t[i-1]-1]
        last[t[i-1]-1]=i
        v-=np.dot(c,i-last)
    if v>MAX:
        MAX=v
        t[d-1]=q

for i in range(D):
    print(t[i])

### FIXED CODE ###

import numpy as np

D=int(input())
c=np.array(list(map(int,input().split())))
s=[list(map(int,input().split())) for _ in range(D)]
t=[np.random.randint(1,27) for _ in range(D)]

MAX=0
for _ in range(1000):
    d=np.random.randint(1,D+1)
    q=np.random.randint(1,27)
    last=np.array([0]*26)
    v=0
    for i in range(1,D+1):
        if i==d:
            v+=s[d-1][q-1]
            last[q-1]=d
            v-=np.dot(c,d-last)
            continue
        v+=s[i-1][t[i-1]-1]
        last[t[i-1]-1]=i
        v-=np.dot(c,i-last)
    if v>MAX:
        MAX=v
        t[d-1]=q

for i in range(D):
    print(t[i])
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a, reverse = True)
max_a = sorted_a[0]
cnt = 0
ans = 0
for i in range(n - 1):
    if a[i] == max_a:
        cnt += 1
        max_a = sorted_a[cnt]
    for j in range(a[i] + i + 1, min(n, a[i] + i + max_a + 1)):
        if a[i] + a[j] == j - i:
            ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
dp = [0] * n
ans = 0
for i, j in enumerate(a):
    if i + j < n:
        dp[i + j] += 1
    if 0 < i - j:
        ans += dp[i - j]
print(ans)
### BUGGY CODE ###

from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    n = int(input())
    ans = 1
    for i in map(int, input().split()):
        ans *= i
    if ans > 1e18:
        print(-1)
    else:
        print(ans)
main()

### FIXED CODE ###

from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    ans = 1
    for i in a:
        ans *= i
        if (ans > 1e18):
            print(-1)
            exit()
    print(ans)
main()
### BUGGY CODE ###

N = input()
N = int(N)
l = [int(input()) for i in range(N)]
flg = 1
ma = 0
for i in range(0,len(l)-1):
    for j in range(i+1,len(l)):
        if(ma < l[j]-l[i] or flg ==1):
            ma = l[j] - l[i]
            flg = 0
print(ma)


### FIXED CODE ###

N = input()
N = int(N)
l = [int(input()) for i in range(N)]
flg = 1
ma = 0
mi = 0
for i in range(1,len(l)):
    if(mi > l[i-1] or flg ==1):
        mi = l[i-1]
    if(ma < l[i] - mi or flg ==1):
        ma = l[i] - mi
        flg = 0
print(ma)
### BUGGY CODE ###

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

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        A_i = A[i]%(10**9+7)
        A_j = A[j]%(10**9+7)
        ans += (A_i * A_j)%(10**9+7)
        ans = ans%(10**9+7)
        
print(ans)

### FIXED CODE ###

N = int(input())
MOD = 10**9 + 7

A = list(map(lambda x: int(x)%MOD, input().split()))
S = []

tmp_s = 0
for A_i in A[::-1]:
    tmp_s += A_i
    S.append(tmp_s%MOD)
S.pop(-1)
S = S[::-1]

ans = 0
for i in range(N-1):
    ans += (A[i] * S[i])%MOD
    ans = ans%MOD
print(ans)
### BUGGY CODE ###

import math


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 1:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]





n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
count = 0
data = a.copy()
prime = []
limit = a[-1]
while len(data) > 0:
  p = data[0]
  if len(data) > 1 and p == data[1]:
    count += 1
  prime.append(p)
  data = [e for e in data if e % p != 0]
  #print(data)
print(len(prime)-count)

### FIXED CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
max_ = max(a)+1
prime_bool = [True]*max_
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p < max_:
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7
import fractions
A_lcm = A[0]
for i in range(1,N):
    A_lcm = A_lcm*A[i]//fractions.gcd(A_lcm,A[i])
ans = 0
for i in A:
    ans += A_lcm//i
print(ans%mod)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
import fractions
mod = 10**9+7
lcm = A[0]
for i in range(1,N):
    lcm = lcm*A[i]//fractions.gcd(lcm,A[i])
ans = 0
for i in range(N):
    ans += lcm*pow(A[i],mod-2,mod)
print(ans%mod)
### BUGGY CODE ###

N,W = map(int, input().split())
WV = [[0,0]]
for i in range(N):
    WV.append(list(map(int, input().split())))

W1 = WV[0][0]
for i in range(N):
    WV[i][0] -= W1
    

dp = [[0 for _ in range(W+1)] for _ in range(N+1)]

W = W-N*W1

for n in range(1,N+1):
    for w in range(W+1):
        if w<WV[n][0]:
            dp[n][w] = dp[n-1][w]
        else:
            dp[n][w] = max(dp[n-1][w],
                           dp[n-1][w-WV[n][0]]+WV[n][1])

print(dp[N][W])

### FIXED CODE ###


from collections import defaultdict

N,W = map(int, input().split())
WV = []
for i in range(N):
    WV.append(list(map(int, input().split())))

dp = defaultdict(int)

dp[0] = 0

for w,v in WV:
    for nw, nv in list(dp.items()):
        if nw+w <= W:
            dp[nw+w] = max(dp[nw+w], nv+v)
            
print(max(dp.values()))
### BUGGY CODE ###

from itertools import combinations


MOD = 1000000007

N = int(input())
S = input()

chars = set()
cnt = {}
for s in S:
    if s not in chars:
        chars.add(s)
        cnt[s] = 1
    else:
        cnt[s] += 1

ans = N % MOD
r = 2
chars = list(chars)
while r <= len(chars):
    combs = combinations(chars, r)
    for comb in combs:
        res = 1
        for c in comb:
            res *= cnt[c]
            res %= MOD
        ans += res
        ans %= MOD
    r += 1

print(ans)


### FIXED CODE ###

MOD = 1000000007

N = int(input())
S = input()

cnt = {}
for s in S:
    if s not in cnt:
        cnt[s] = 1
    else:
        cnt[s] += 1

ans = 1
for v in cnt.values():
    ans *= v + 1
    ans %= MOD

print(ans - 1)
### BUGGY CODE ###

# coding: utf-8
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    num = 0
    b = a.pop(0)
    for j in range(n):
        c = a.count(j)
        num += int(c*(c-1)/2)
    print(num)
    a.append(b)

### FIXED CODE ###

# coding: utf-8
n = int(input())
A = list(map(int, input().split()))
X = [0]*(n+1)
for a in A:
    X[a] += 1
s = 0
for x in X:
    s += x*(x-1)//2
for a in A:
    print(s-X[a]+1)
### BUGGY CODE ###

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

ans = 0
for j in range(n):
    ans += 0^a[j]

if k != 0:
    for i in range(1,k+1):
        ans_temp = 0
        for j in range(n):
            ans_temp += i ^ a[j]
        ans = max(ans, ans_temp)

print(int(ans))

### FIXED CODE ###

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

ans = 0

for i in range(40,-1,-1):
    power = 1 << i
    #<<...ビット演算子「左シフト」。(=値２倍)
    bit_count_of_1 = sum(1 for a in a if a & power != 0) #i番目のビットに1はいくつあるか?

    if power > k: # power > kなら、kの該当ビットは必ず0なので、寄与はその時点で決定
        ans += power * bit_count_of_1
    elif bit_count_of_1 > n - bit_count_of_1: #その桁で1の方が多いならxの最適解は0。
        ans += power * bit_count_of_1
    else:
        ans += power * (n - bit_count_of_1)
        k -= power

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

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

import math
def combi(n,r):
    return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
from bisect import bisect_left

max_combi = 0
l=0
r=1
for i in range(1,n):
    idx = bisect_left(a, (a[i]+1)//2)
    if a[idx] > (a[i]+1)//2:
        idx -= 1
    c = combi(a[i], a[idx])
    if c > max_combi:
        max_combi = c
        x,y = a[i], a[idx]

print(x,y)


### FIXED CODE ###

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

import bisect

mid = (a[-1]+1)//2
mid_idx = bisect.bisect_left(a, mid)

if abs(mid - a[mid_idx-1]) <= abs(a[mid_idx] - mid):
    print(a[-1], a[mid_idx-1])
else:
    print(a[-1], a[mid_idx])
### BUGGY CODE ###

#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a

def chmax(a, b):
    if a < b:
        return b
    else:
        return a

def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    dp = [inf] * 110000

    dp[0] = 0
    for i in range(n-1):
        for j in range(1, min(k+1, n-i)):
            dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i+j] - h[i]))
    print(dp[n-1])

if __name__ == '__main__':
    main()



### FIXED CODE ###

#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a

def chmax(a, b):
    if a < b:
        return b
    else:
        return a

def main():
    n, k = map(int, input().split())
    h = tuple(map(int, input().split()))
    dp = [inf] * 110000

    dp[0] = 0
    for i in range(n-1):
        for j in range(1, min(k+1, n-i)):
            dp[i+j] = chmin(dp[i+j], dp[i] + abs(h[i+j] - h[i]))
    print(dp[n-1])

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

N = int(input())
ABC = []
for _ in range(N-1):
    a,b,c = map(int, input().split())
    ABC.append((a,b,c))

Q, K = map(int, input().split())
XY = []
for _ in range(Q):
    x,y = map(int, input().split())
    XY.append((x,y))
    
# bellman_ford(edges,num_v,source)
# エッジのリストと超点数、スタート地点をinput
# リターンはスタート地点からの各ノードへの最短距離、負の閉路があれば-1*INT_MAXを返す


import sys
INT_MAX = sys.maxsize # 9223372036854775807

def bellman_ford(edges,num_v,source):

    dist=[INT_MAX] * num_v
    dist[source]=0

    #辺の緩和
    has_negative = False
    for i in range(num_v):
        for edge in edges:
            if edge[0] != INT_MAX and dist[edge[1]] > dist[edge[0]] + edge[2]:
                dist[edge[1]] = dist[edge[0]] + edge[2]
                if i==num_v-1:
                    has_negative = True
    
    if has_negative == False:
        return dist
    
    negative = [False] * num_v
    for i in range(num_v):
        for from_edge, to_edge, cost in edges:
            if dist[from_edge] == INT_MAX:
                continue
            if dist[to_edge] > dist[from_edge] + cost:
                dist[to_edge] = dist[from_edge] + cost
                negative[to_edge] = True
            
            if negative[from_edge] == INT_MAX:
                negative[to_edge] = True
                
    for i, is_negative in enumerate(negative):
        if is_negative:
            dist[i] = -1 * INT_MAX
        
    return dist



edges = ABC[:]
for a,b,c in edges[:]:
    edges.append((b,a,c))


shortest = []

for i in range(0, N+1):
    sub_shortest=bellman_ford(edges, N+1, i)
    shortest.append(sub_shortest)
    #print(sub_shortest)
    
question = XY[:]

for x,y in question:
    ans = shortest[x][K] + shortest[K][y]
    print(ans)


### FIXED CODE ###

N = int(input())
ABC = []
for _ in range(N-1):
    a,b,c = map(int, input().split())
    ABC.append((a,b,c))

Q, K = map(int, input().split())
XY = []
for _ in range(Q):
    x,y = map(int, input().split())
    XY.append((x,y))
    
edges = ABC[:]

graph = {}
for a,b,c in edges:
    if not a in graph:
        graph[a] = {}
    if not b in graph:
        graph[b] = {}
    graph[a][b] = c
    graph[b][a] = c


from heapq import heappush, heappop

def dijkstra(graph, start):
    A = [None] * (N+1)
    queue = [(0, start)]
    while queue:
        path_len, v = heappop(queue)
        if A[v] is None: # v is unvisited
            A[v] = path_len
            for w, edge_len in graph[v].items():
                if A[w] is None:
                    heappush(queue, (path_len + edge_len, w))

    # to give same result as original, assign zero distance to unreachable vertices             
    return [0 if x is None else x for x in A]

shortest = dijkstra(graph, K)
#print(shortest)

questions = XY

for x,y in questions:
    ans = shortest[x] + shortest[y]
    print(ans)
### BUGGY CODE ###

values = raw_input()
n,x = int(values.split(" ")[0]), int(values.split(" ")[1])
cities = raw_input()
cities = [int(i) for i in cities.split(" ")]

distances = []
for i in cities:
	distances.append(abs(i-x))
m = max(distances)

D = m
while(D<=m):
	pos = x
	flag = True
	for i in range(len(cities)):
		if cities[i]<pos:
			k = (cities[i]-pos)/float(-D)
		else:
			k = (cities[i]-pos)/float(D)
		if k!=int(k):
			flag = False
		pos = cities[i]
		#print("\t",k, pos)

	if flag == True:
		print(D)
		break
	D -= 1

### FIXED CODE ###

values = raw_input()
n,x = int(values.split(" ")[0]), int(values.split(" ")[1])
cities = raw_input()
cities = [int(i) for i in cities.split(" ")]

cities = sorted(cities)

distances = []
for i in cities:
	distances.append(abs(i-x))
for i in range(1,len(cities)):
	distances.append(abs(cities[i]-cities[i-1]))

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

m = distances[0]
for i in range(1,len(distances)):
	m = hcd(m, distances[i])
print(m)
### BUGGY CODE ###

def divs(num):
    ans = []
    for i in range(1,int(num**(1/2)+1)):
        if num%i == 0:
            ans += [i,num//i]
    return set(ans)
n = int(input())
a = list(map(int,input().split()))
fin = []
ans = [0]*(n+1)
for i in range(n,0,-1):
    # print(i,a[i-1],ans[i])
    if a[i-1]^ans[i]:
        fin += [i]
        div = divs(i)
        # print(div)
        for j in div:
            ans[j] ^= 1
print(len(fin))
print(*fin)

### FIXED CODE ###

def divs(num):
    ans = []
    for i in range(1,int(num**(1/2)+1)):
        if num%i == 0:
            ans += [i,num//i]
    return set(ans)
n = int(input())
a = list(map(int,input().split()))
fin = []
ans = [0]*(n+1)
for i in range(n,0,-1):
    # print(i,a[i-1],ans[i])
    if a[i-1]^ans[i]:
        fin += [i]
        div = divs(i)
        # print(div)
        for j in div:
            ans[j] ^= 1
print(len(fin))
print(*fin)
### BUGGY CODE ###

import math
	
N,M = map(int,raw_input().split())

def factorize(n):
	fct = []  # prime factor
	b, e = 2, 0  # base, exponent
	while b * b <= n:
		while n % b == 0:
			n = n / b
			e = e + 1
		if e > 0:
			fct.append((b, e))
		b, e = b + 1, 0
	if n > 1:
		fct.append((n, 1))
	return fct

fct= factorize(M)

ans = 1

for f in fct:
	ans=(ans *(math.factorial(f[1]+N-1)/(math.factorial(f[1])*math.factorial(N-1))))%(10**9+7)

print ans

### FIXED CODE ###

N,M = map(int,raw_input().split())

def factorize(n):
	fct = []  # prime factor
	b, e = 2, 0  # base, exponent
	while b * b <= n:
		while n % b == 0:
			n = n / b
			e = e + 1
		if e > 0:
			fct.append((b, e))
		b, e = b + 1, 0
	if n > 1:
		fct.append((n, 1))
	return fct

def comb(n,r):
	ans = 1
	for i in range(r):
		ans=ans*(n-i)
		ans=ans/(i+1)
	return ans%(10**9 + 7)

fct= factorize(M)

ans = 1

for f in fct:
	ans=(ans *comb(f[1]+N-1,f[1]))%(10**9+7)

print ans
### BUGGY CODE ###

import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import deque, defaultdict
def main():
    n, c, k = map(int, input().split())
    times = defaultdict(int)
    for _ in range(n):
        times[int(input()) + k] += 1

    r = 0
    for i1 in range(min(times.keys()), max(times.keys()) + 1):
        if times[i1]:
            if times[i1] >= c:
                p = times[i1] // c
                r += p
                times[i1] - p * c
            else:
                r += 1
                g = c - times[i1]
                for i2 in range(i1+1, i1+k+1):
                    if times[i2]:
                        if times[i2] <= g:
                            g -= times[i2]
                            times[i2] = 0
                        else:
                            times[i2] -= g
                            break
    print(r)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
from math import floor
def main():
    n, c, k = map(int, input().split())
    times = defaultdict(int)
    for _ in range(n):
        times[int(input()) + k] += 1
    # ts:時間順に「時間ごとの出発したい人数」を並べたもの
    ts = dict(sorted(times.items()))

    r = 0
    busg = c # バスに乗せられる人数
    busstart = - k - 1
    for tse in ts:
        if busstart + k < tse: # 前のバスに間に合わない場合。バスを仕立てる
            r += floor(ts[tse] / c) # 満員になるバス台数を+する。
            nokori = ts[tse] % c
            if nokori: # 残りがいるならバスを仕立てる。
                r += 1
                busg = c - nokori
                busstart = tse
            else:
                busstart = -k - 1
        else:
            if busg >= ts[tse]: #バスに乗りきれる場合
                busg -= ts[tse]
            else:             # バスに乗り切れない場合。バスを仕立てる。
                r += floor(ts[tse] / c)
                nokori = ts[tse] % c
                if nokori:
                    r += 1
                    busg = c - nokori
                    busstart = tse
                else:
                    busstart = -k - 1
    print(r)

if __name__ == '__main__':
    main()