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

# -*- coding: utf-8 -*-

def count(val1, val2):
    num = 1
    while True:
        if val1 < (val2 ** num):
            res = 0
            if num > 1:
                res = val2 ** (num-1)

            break  
        num += 1

    return res


N = int(input())
ans = N

for i in range(0,N+1):
    n = i
    m = N - i
    res = 0

    while True:
        num = count(n, 9)
        if num == 0:
            break
        n -= num
        res += 1

    while True:
        num = count(m, 6)
        if num == 0:
            break
        m -= num
        res += 1

    res += n + m
    ans = min(ans, res)


print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

def count(val1, val2):
    num = 1
    while True:
        if val1 < (val2 ** num):
            break
        num += 1

    cnt = 0
    digit = num
    while True:
        if val1 >= val2 ** digit:
            val1 -= val2 ** digit
            cnt += 1
        else:
            digit -= 1
        
        if digit== 0:
            break

    return cnt,val1


N = int(input())
ans = N

for i in range(0,N+1):
    n = i
    m = N - i
    res = 0

    cnt, nn = count(n, 9)
    n = nn
    res += cnt

    cnt, mm = count(m, 6)
    m = mm
    res += cnt

    res += n + m
    ans = min(ans, res)

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

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

for _ in range(m):
    maximum = max(zip(a, range(len(a))))[1]
    a[maximum] = a[maximum] // 2

print(sum(a))


### FIXED CODE ###

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

n, m = map(int, input().split())
a = list(map(int, input().split()))
a_minus = [-x for x in a]
heapify(a_minus)

pop = lambda: -heappop(a_minus)
push = lambda x: heappush(a_minus,-x)

for _ in range(m):
    x = pop()
    push(x//2)

print(-sum(a_minus))
### BUGGY CODE ###

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

ret = 0
cnt_0 = [0] * 60
cnt_1 = [0] * 60

for item in a_ls:
    for i in range(60):
        if len(bin(item)) <= i:
            cnt_0[i] += 1
        elif bin(item)[-1-i] == '1':
            cnt_1[i] += 1
        else:
            cnt_0[i] += 1

for i in range(60):
    tmp = (cnt_0[i] * cnt_1[i])
    for _ in range(i):
        tmp *= 2
        tmp %= 10 ** 9 + 7
    ret += tmp
    ret %= 10 ** 9 + 7

print(ret)


### FIXED CODE ###

def str2bitstr(chs):
    val = int(chs)
    tmp = bin(val)[2:]
    tmp2 = '0' * (60 - len(tmp))
    return tmp2 + tmp


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

cnts = [0] * 60

for item in a:
    for i, ch in enumerate(item):
        if ch == '1':
            cnts[i] += 1

ret = 0
now = 1

for i in range(1, 61):
    kumi = cnts[-i] * (n - cnts[-i]) % (10 ** 9 + 7)
    ret += kumi * now % (10 ** 9 + 7)
    now *= 2 % (10 ** 9 + 7)
    ret = ret % (10 ** 9 + 7)

print(ret % (10 ** 9 + 7))
### BUGGY CODE ###

import itertools
n = int(input())
li = list(map(int,input().split()))
asum = 0
newli = list(itertools.combinations(li,2))
for i in range(n*(n-1)//2):
    asum += newli[i][0]*newli[i][1]
    if asum >= 10**9 + 7:
        asum = asum % (10**9 + 7)
print(asum)

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
licumsum = 0
for i in range(n):
    licumsum += li[i]
asum = 0
for i in range(n):
    asum += li[i]*(licumsum - li[i])
    if asum >= (10**9 + 7)*2:
        asum = asum % ((10**9 + 7)*2)
if asum//2 >= 10**9 + 7:
    print(asum//2-(10**9+7))
else:
    print(asum//2)
### BUGGY CODE ###

N = int(input())
A = []

class Node:
    def __init__(self, data): #コンストラクタ
        self.data = data #ノードがもつ数値
        self.left = None #左エッジ
        self.right = None #右エッジ

class BST:
    def __init__(self, number_list): #コンストラクタ
        self.root = None #ルート初期化
        self.ans = 1
        for node in number_list: #数値を持つ配列から二分木を生成
            self.insert(node) #挿入メソッドを使ってノードを挿入する

    def insert(self, data):
        n = self.root #nにルートを代入
        if n == None: #ルートに何も入っていない場合
            self.root = Node(data) #ルートにノードを代入(二分探索木の一番上の部分が出来る)
            return #呼び出し部分に戻る
        else: #ルートノードに既に数値が入ってる場合
            while True: #return等が入るまでずっと実行
                entry = n.data #entryにnが持つデータ(数値)を入れる
                if data <= entry: #entryとdata(代入するデータ)を比較してentryの方が大きい場合
                    if n.left is None: #nの左エッジに何も入っていない場合
                        n.left = Node(data) #nの左エッジにdata(代入するデータ)を代入
                        self.ans += 1
                        return ##呼び出し部分に戻る
                    n = n.left #nの左に何か入っている場合nにnのleftを代入
                else: #entryとdata(代入するデータ)を比較してentryの方が小さい場合
                    if n.right is None: #nの右エッジに何も入っていない場合
                        n.right = Node(data) #nの右エッジにdata(代入するデータ)を代入
                        return #呼び出し部分に戻る
                    n.data = data
                    n = n.right #nの右エッジに何か入っている場合nにnのrightを代入
    def getAns(self) :
        return self.ans


for _ in range(N) :
    a = int(input())
    A.append(a)

tree = BST(A)

print(tree.getAns())

### FIXED CODE ###

import bisect

N = int(input())
A = []

a = int(input())

val = [-a]
length = 1

for _ in range(N - 1) :
    a = int(input())
    a *= -1
    i = 0

    index = bisect.bisect_right(val, a)
    if index >= length :
        val.append(a)
        length += 1
    else :
        val[index] = a

print(length)
### BUGGY CODE ###

n = int(input())
s_list = []
for _ in range(n):
    s = "".join(sorted(input()))
    s_list.append(s)

count = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s_list[i] == s_list[j]:
            count += 1

print(count)


### FIXED CODE ###

n = int(input())
d = {}

ans = 0
for _ in range(n):
    s = "".join(sorted(input()))
    if not s in d:
        d[s] = 0
    else:
        d[s] += 1
        ans += d[s]

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

import math

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

for i in range(1, N + 1):
    temp = math.floor(A*i/B) - (A * math.floor(i/B))
    if max < temp:
        max = temp

print(max)

### FIXED CODE ###

import math

A, B, N = map(int, input().split())
max = 0
temp = 0
bk_temp = 0

if B <= N:
    max = math.floor(A * (B - 1) / B) - (A * math.floor((B - 1) / B))
else:
    # for i in range(1, N + 1):
    #     temp = math.floor(A*i/B) - (A * math.floor(i/B))
    #     print(str(i) + ' ' + str(temp))
    #     if bk_temp > temp:
    #         max = bk_temp
    #         break
    #     if max < temp:
    #         max = temp
    #     bk_temp = temp
    max = math.floor(A * N / B) - (A * math.floor((N) / B))

print(max)
### BUGGY CODE ###

import re


def main():
    S = input()
    lens = len(S)
    while len(S):
        S = re.sub("dreamer$", "", S)
        S = re.sub("eraser$", "", S)
        S = re.sub("dream$", "", S)
        S = re.sub("erase$", "", S)
        if lens == len(S):
            print("NO")
            return
    print("YES")
    return


main()


### FIXED CODE ###

dreamer = "dreamer"
eraser = "eraser"
dream = "dream"
erase = "erase"


def main():
    S = input()

    while len(S):
        lens = len(S)
        if S[lens - len(dreamer):] == dreamer:
            S = S[: lens - len(dreamer)]
        elif S[lens - len(eraser):] == eraser:
            S = S[:lens - len(eraser)]
        elif S[lens - len(dream):] == dream:
            S = S[:lens - len(dream)]
        elif S[lens - len(erase):] == erase:
            S = S[:lens - len(erase)]
        if lens == len(S):
            print("NO")
            return
    print("YES")
    return


main()
### BUGGY CODE ###

def popcount(n):
    return bin(n).count("1")

N = int(input())
X = int(input(), 2)

result = []
for i in range(N):
    n = X ^ (1 << (N - 1 - i))
    t = 0
    while n != 0:
        n %= popcount(n)
        t += 1
    result.append(t)
print(*result, sep='\n')


### FIXED CODE ###

def popcount(n):
    return bin(n).count("1")


def f(n):
    if n == 0:
        return 0
    return 1 + f(n % popcount(n))


N = int(input())
X = input()

c = X.count('1')
t1 = [0] * N
t1[0] = 1 % (c + 1)
for i in range(1, N):
    t1[i] = (t1[i - 1] << 1) % (c + 1)
x1 = 0
for i in range(N):
    if X[i] == '0':
        continue
    x1 += t1[N - 1 - i]

if c - 1 != 0:
    t2 = [0] * N
    t2[0] = 1 % (c - 1)
    for i in range(1, N):
        t2[i] = (t2[i - 1] << 1) % (c - 1)
    x2 = 0
    for i in range(N):
        if X[i] == '0':
            continue
        x2 += t2[N - 1 - i]

result = []
for i in range(N):
    if X[i] == '0':
        n = (x1 + t1[N - 1 - i]) % (c + 1)
    elif X[i] == '1':
        if c - 1 == 0:
            result.append(0)
            continue
        n = (x2 - t2[N - 1 - i]) % (c - 1)
    result.append(1 + f(n))
print(*result, sep='\n')
### BUGGY CODE ###

def f(x, y, z):
    return (x+y+z)**2 - x*y - y*z - z*x


N = int(input())
for i in range(1, N+1):
    ans = 0
    for x in range(1, int(i**0.5)+2):
        for y in range(1, int(i**0.5)+2):
            if x**2 + y**2 + x*y >= i:
                break
            l = 0
            r = int(i**0.5) + 1
            while r >= l:
                z = (r+l) // 2
                if f(x, y, z) == i:
                    ans += 1
                if f(x, y, z) > i:
                    r = z - 1
                else:
                    l = z + 1

    print(ans)


### FIXED CODE ###

def f(x, y, z):
    return (x+y+z)**2 - x*y - y*z - z*x


N = int(input())
for i in range(1, N+1):
    ans = 0
    for x in range(1, int(i**0.5)+2):
        for y in range(x, int(i**0.5)+2):
            if f(x, y, y-1) >= i:
                break
            l = y - 1
            r = int(i**0.5) + 1
            while r >= l:
                z = (r+l) // 2
                if f(x, y, z) == i:
                    if x < y:
                        if x == z or y == z:
                            ans += 3
                        else:
                            ans += 6
                    else:
                        if z == y:
                            ans += 1
                        else:
                            ans += 3
                if f(x, y, z) > i:
                    r = z - 1
                else:
                    l = z + 1

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

def StrConv(S, T, F, C):
  ans = ''
  if T == '1':
    ans = S[::-1]
  else:
    if F == '1':
      ans = C + S
    else:
      ans = S + C
  return ans
  
#パラメータの取得
S = input()
Q = int(input())
dumy = '|' #仮の文字列くみ上げ変数
cnt = 0   #反転回数カウンタ

#処理実体処理
for i in range(Q):
  tmp = str(input())
  #Q各行の値を、T, F, Cに基づいて処理
  if tmp[0] == '1':
    T = tmp[0]
    F = '-'
    C = '-'
    cnt += 1
  else:
    T, F, C = tmp.split(' ')
  #変換処理本体
  dumy = StrConv(dumy, T, F, C)

#文字列結合処理
if (cnt % 2) == 0:
  ans = dumy[0:dumy.find('|')] + S + dumy[dumy.find('|')+1:]
else:
  ans = dumy[0:dumy.find('|')] + S[::-1] + dumy[dumy.find('|')+1:]
print(ans)

### FIXED CODE ###

#パラメータの取得
S = input()
Q = int(input())
cnt = 0   #反転回数カウンタ
head = ''
tail = ''

#処理実体処理
for i in range(Q):
  tmp = str(input())
  #Q各行の値を、T, F, Cに基づいて処理
  if tmp[0] == '1':
    cnt += 1
  else:
    T, F, C = tmp.split(' ')
    if cnt % 2 == 1:
      if F == '1':
        tail = tail + C
      else:
        head = C + head
    else:
      if F == '1':
        head = C + head
      else:
        tail = tail + C
    #cnt = 0
  #print('head=',head)
  #print('tail=',tail)

#print('cnt=',cnt)
if cnt % 2 == 0:
  ans = head + S + tail
else:
  ans = tail[::-1] + S[::-1] + head[::-1]
print(ans)
### BUGGY CODE ###

n = int(input())
s = []
count = 0
for i in range(n):
    a = input()
    if not(a in s):
        s.append(a)
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
d = {}
for i in range(n):
    s = input()
    if not(s in d): d[s] = 1

print(len(d))
### BUGGY CODE ###

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

ans = []
for i in range(n):
    a, b = map(int, input().split())
    ans.append([a]*b)

ans = sorted(sum(ans, []))
print(ans[k-1])


### FIXED CODE ###

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

dict_num = {}
for i in range(n):
    a, b = map(int, input().split())
    if a in dict_num:
        dict_num[a] += b
    else:
        dict_num[a] = b

array = []
for n, t in dict_num.items():
    array.append([n, t])

array.sort()

cnt = 0
for a in array:
    cnt += a[1]
    if cnt >= k:
        print(a[0])
        break
### BUGGY CODE ###

from itertools import accumulate
N = int(input())
A = list(map(int, input().split()))
acc = [0] + list(accumulate(A))

# dp[i][j] := 区間[i, j]のスライムたちを１匹にまとめるのに必要なコスト
dp = [[None] * N for _ in range(N)]
for i in range(N):
    dp[i][i] = 0


def dfs(i, j):
    if j - i == 1:
        dp[i][j] = A[i] + A[j]
        return dp[i][j]

    if dp[i][j] is not None:
        return dp[i][j]

    ret = float('inf')
    for x in range(i, j):
        ret = min(ret, dfs(i, x) + dfs(x + 1, j) + acc[j + 1] - acc[i])

    dp[i][j] = ret
    return ret


print(dfs(0, N - 1))


### FIXED CODE ###

import sys
from itertools import accumulate
sys.setrecursionlimit(10 ** 9)

N = int(input())
A = list(map(int, input().split()))
acc = [0] + list(accumulate(A))

# dp[i][j] := 区間[i, j]のスライムたちを１匹にまとめるのに必要なコスト
dp = [[None] * N for _ in range(N)]
for i in range(N):
    dp[i][i] = 0


def dfs(i, j):
    if j - i == 1:
        dp[i][j] = A[i] + A[j]
        return dp[i][j]

    if dp[i][j] is not None:
        return dp[i][j]

    ret = float('inf')
    for x in range(i, j):
        ret = min(ret, dfs(i, x) + dfs(x + 1, j) + acc[j + 1] - acc[i])

    dp[i][j] = ret
    return ret


print(dfs(0, N - 1))
### BUGGY CODE ###

def dfs(tree, v, tv, p, es):
    if v == tv:
        return True
    for e in tree[v]:
        if e[0] == p:
            continue
        if dfs(tree, e[0], tv, v, es):
            es.append(e[1])
            return True
    return False


def get_bit_count(bit):
    return format(bit, 'b').count('1')


def main():
    n = int(input())
    tree = [[] for i in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        tree[a].append((b, i))
        tree[b].append((a, i))
    m = int(input())
    eset = [0]*m
    for i in range(m):
        u, v = map(int, input().split())
        es = []
        dfs(tree, u-1, v-1, -1, es)
        for e in es:
            eset[i] |= 1 << e

    ans = 0
    for i in range(1 << m):
        mask = 0
        for j in range(m):
            if i >> j & 1:
                mask |= eset[j]
        white = get_bit_count(mask)
        now = 1 << (n-1-white)
        if get_bit_count(i) % 2 == 0:
            ans += now
        else:
            ans -= now
    print(ans)


main()


### FIXED CODE ###

def dfs(tree, v, tv, p, es):
    if v == tv:
        return True
    for e in tree[v]:
        if e[0] == p:
            continue
        if dfs(tree, e[0], tv, v, es):
            es.append(e[1])
            return True
    return False


def main():
    n = int(input())
    tree = [[] for i in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        tree[a].append((b, i))
        tree[b].append((a, i))
    m = int(input())
    eset = [0]*m
    for i in range(m):
        u, v = map(int, input().split())
        es = []
        dfs(tree, u-1, v-1, -1, es)
        for e in es:
            eset[i] |= 1 << e

    ans = 0
    for i in range(1 << m):
        mask = 0
        for j in range(m):
            if i >> j & 1:
                mask |= eset[j]
        white = bin(mask).count('1')
        now = 1 << (n-1-white)
        if bin(i).count('1') % 2 == 0:
            ans += now
        else:
            ans -= now
    print(ans)


main()
### BUGGY CODE ###

if __name__ == '__main__':
    one_thousand, five_thousand, ten_thousand = 1000, 5000, 10000
    n, y = map(int, input().split())
    ans = []
    for i in range(0, n+1):
        for j in range(0, n+1):
            k = n - (i + j)
            one = one_thousand * i
            five = five_thousand * j
            ten = ten_thousand * k
            sum_price = one + five + ten
            if k >= 0 and n == i + j + k and sum_price == y:
                ans.append([k, j, i])
                break
        if ans != []:
            print(ans[0][0], ans[0][1], ans[0][2])
            break
    if ans == []:
        print(-1, -1, -1)


### FIXED CODE ###

if __name__ == '__main__':
    one_thousand, five_thousand, ten_thousand = 1000, 5000, 10000
    n, y = map(int, input().split())
    ans = []
    for i in range(0, n+1):
        for j in range(0, n+1-i):
            k = n - (i + j)
            one = one_thousand * i
            five = five_thousand * j
            ten = ten_thousand * k
            sum_price = one + five + ten
            if k >= 0 and n == i + j + k and sum_price == y:
                ans.append([k, j, i])
                break
        if ans != []:
            print(ans[0][0], ans[0][1], ans[0][2])
            break
    if ans == []:
        print(-1, -1, -1)
### BUGGY CODE ###

h,w=map(int,input().split())
a=[list(input()) for i in range(h)]

#上下左右のマスを黒くしていく
#BFS
from collections import deque
def bfs():
    dx=[0,1,0,-1]
    dy=[1,0,-1,0]
    log=[[0]*w for i in range(h)]

    que=deque([])
    for i in range(h):
        for j in range(w):
            if a[i][j]=='#':
                que.append((i,j))

    while que:
        #queの先頭を取り出す
        p=que.popleft()
        for i in range(4):
            nx=p[0]+dx[i]
            ny=p[1]+dy[i]

            if not(0<=nx<h and 0<=ny<w):continue
            if log[nx][ny]!=0:continue
            que.append((nx,ny))
            a[nx][ny]='#'
            log[nx][ny]=log[p[0]][p[1]]+1

    return log

G=bfs()
ans=0
for i in range(h):
    for j in range(w):
        if ans<G[i][j]:
            ans=G[i][j]
print(ans)

### FIXED CODE ###

from collections import deque
H,W=map(int,input().split())
a=[list(input()) for i in range(H)]
#print(a)
#黒のマスを探索する
#黒のマスの周囲四マスを黒に変更する
#探索済みのところはTrueにする
log=[[-1]*W for i in range(H)]
def bfs():
    task=deque([])
    #初め黒のマスを検索する
    for i in range(H):
        for j in range(W):
            if a[i][j]=='#':
                task.append((i,j))
                log[i][j]=0

    dh=[0,1,0,-1]
    dw=[1,0,-1,0]

    while task:
        h,w=task.popleft()
        #四マスを探索する
        for i in range(4):
            nh=h+dh[i]
            nw=w+dw[i]
            if not(0<=nh<H and 0<=nw<W):continue
            if a[nh][nw]=='#':continue
            a[nh][nw]='#'
            log[nh][nw]=log[h][w]+1
            task.append((nh,nw))

def ans_check():
    ans=0
    for i in range(H):
        for j in range(W):
            if ans<log[i][j]:ans=log[i][j]

    print(ans)

bfs()
ans_check()
### BUGGY CODE ###

import heapq
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def main():
    N = int(input().strip())
    divisors = set()
    ans = set()
    l = [int(i) for i in input().strip().split()]
    heapq.heapify(l)

    for _ in range(N):
        n = heapq.heappop(l)

        if n in divisors:
            if n in ans:
                ans.remove(n)
            continue

        divs = make_divisors(n)

        for d in divs:
            if d in divisors:
                divisors.add(n)
                break
        else:
            divisors.add(n)
            ans.add(n)

    return len(ans)


if __name__ == "__main__":
    print(main())


### FIXED CODE ###

import heapq
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    l = [int(i) for i in input().strip().split()]
    ans = 0
    m = max(l)
    dp = [0] * (m+1)

    for n in l:
        for j in range(n, m + 1, n):
            dp[j] += 1

    for n in l:
        if dp[n] == 1:
            ans += 1

    return ans


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

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

def gcd(n1,n2):
  if n1<n2:
    n1,n2 = n2,n1
  while (n2>0):
    r = n1%n2
    n1 = n2
    n2 = r
  return n1

def gcd_list(l):
  if len(l)==1: return l[0]
  else:
    g = gcd(l[0],l[1])
    for i in range(2,len(l)):
      g = gcd(g,l[i])
    return g
t_g = 1
for i in range(1,n-1):
  l_g = gcd_list(num[0:i])
  r_g = gcd_list(num[i+1:n])
  t_g = max(t_g,gcd(l_g,r_g))

t_g = max(t_g,gcd_list(num[1:n]))
t_g = max(t_g,gcd_list(num[0:n-1]))
print(t_g)

### FIXED CODE ###

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

from fractions import gcd
l = [0]
r = [0]
for i in range(n-1):
  l += [gcd(l[i],num[i])]
  r += [gcd(r[i],num[-i-1])]
  
print(max(gcd(r[i],l[-i-1]) for i in range(n)))
### BUGGY CODE ###

import math

N=int(input())
count=[0]*(N+1)
for i in range(1,N+1):
  for x in range(1,int(math.sqrt(N+1))):
    for y in range(1,int(math.sqrt(N+1))):
      for z in range(1,int(math.sqrt(N+1))):
        if((x+y+z)**2-(x*y+y*z+z*x)==i):
          count[i]+=1
  print(count[i])
  

### FIXED CODE ###

N=int(input())
count=[0]*(N+1)
for x in range(1,100):
  for y in range(1,100):
    for z in range(1,100):
      n=x*x+y*y+z*z+x*y+y*z+z*x
      if(n<=N):
        count[n]+=1
for i in range(1,N+1):
  print(count[i])
### BUGGY CODE ###

import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, K = inm()
A = inl()


def solve():
    p = 1
    for i in range(K):
        p *= A[i]
    for i in range(K, N):
        p1 = p
        p *= A[i]
        p /= A[i - K]
        if p > p1:
            print("Yes")
        else:
            print("No")


solve()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

N, K = inm()
A = inl()


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


solve()
### BUGGY CODE ###

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

dp = [0] * (S+1)
ans = 0
mod = 998244353


for i in range(N):
 
    ndp = []
    for ll in dp:
        ndp.append(ll)
 
    if A[i] <= S:
        ndp[A[i]] += i+1
        ndp[A[i]] %= mod
 
    for j in range(S):
        if j+A[i] <= S:
            ndp[j+A[i]] += dp[j]
            ndp[j+A[i]] %= mod
 
    ans += ndp[S]
    ans %= mod
 
    dp = ndp

print(ans)


### FIXED CODE ###

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

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

"""
dpなのはそうだろう
普通に行けば、ナップサックdpでいける
S以下のみしか保持しなくていい

始点を保持してしまうと、Sになった時に…？
始点より左にあるやつの個数の和を記録しておけばいい！

連続してなくていいから
"""

dp = [0] * (S+1)
ans = 0
mod = 998244353

for i in range(N):

    ndp = []
    for ll in dp:
        ndp.append(ll)

    if A[i] <= S:
        ndp[A[i]] += i+1
        ndp[A[i]] %= mod

    for j in range(S):

        if j+A[i] <= S:
            ndp[j+A[i]] += dp[j]
            ndp[j+A[i]] %= mod

    ans += ndp[S]
    ans %= mod

    dp = ndp

    #print (dp)

    
print (ans)