Problem:


Score: 300 points

Problem Statement

M-kun is a student in Aoki High School, where a year is divided into N terms.

There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:

For the first through (K-1)-th terms: not given.

For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.

M-kun scored A_i in the exam at the end of the i-th term.

For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.

Constraints

2 \leq N \leq 200000

1 \leq K \leq N-1

1 \leq A_i \leq 10^{9}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K
A_1 A_2 A_3 \ldots A_N

Output

Print the answer in N-K lines.

The i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.

Sample Input 1

5 3
96 98 95 100 20

Sample Output 1

Yes
No

His grade for each term is computed as follows:

3-rd term: (96 \times 98 \times 95) = 893760

4-th term: (98 \times 95 \times 100) = 931000

5-th term: (95 \times 100 \times 20) = 190000

Sample Input 2

3 2
1001 869120 1001

Sample Output 2

No

Note that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.

Sample Input 3

15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9

Sample Output 3

Yes
Yes
No
Yes
Yes
No
Yes
Yes



Sample input:
5 3
96 98 95 100 20


Sample output:
Yes
No

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
point=[1.0]*(N+1)
for i in range(K):
    point[K]=point[K]*A[i]
M=N-K+1
for i in range(1,M):
    point[K+i]=round(point[K+i-1]/A[i-1])*A[K+i-1]
for i in range(M-1):
    if point[K+i]<point[K+i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
T = list(map(int,input().split()))
Number = []
for j in range(N-K+1):
    Num=1
    for i in range(K):
        Num *=T[i+j]/10***3
    Number.append(Num)

for p in range(N-K):
    if Number[p+1] - Number[p] >0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N, K = list(map(int,input().split()))
 
A = list(map(int,input().split()))
 
for i in range(N - K):
  if A[i] < A[i + K + 1]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = [int(input()) for i in range (1, n+1)]

if k+1<=i<=n:
  if a[i-1]>a[i-k-1]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
a_num = 1
for i in range(0,M):
  a_num = a_num*a[i]  
for i in range(M,N):
  a_num =(a_num/a[i-M])*a[i]
  if i>M-1:
    if d[i-M]<d[i-M+1]:
      print("Yes")
    else:
      print("No")

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = [int(input()) for i in range (1, n+1)]

if k+1<=i<=n:
  if a[i-1]>a[i-k-1]:
    print("Yes")
  else:
    print("No")
else:
  break

Submission status: Runtime Error

Solution code:
n = input().split()
n = [int(i) for i in n]
m = input().split()
m = [int(i) for i in m]

point_range = n[0]-(n[1]-1)
point_list = []
point = 1

def cal(n,lis):
    if n == 1:
        return lis[0] 
    else:
        return lis[n-1] * cal(n-1,lis)

count = 0
for j in range(n[1],n[0]+1):
    point = cal(n[1],m[count:j])
    if count != 0:
        if point > pre_point:
            print("Yes")
        else:
            print("No")

    pre_point = point
    point = 1
    count += 1

Submission status: Runtime Error

Solution code:
# [] = list(map(int, input().split()))
# = map(int, input().split())

# C
import numpy as np
[n, k] = list(map(int, input().split()))
aList = list(map(int, input().split()))
aList_kai = []
if k < n//2:
    aList_kai.append(np.prod(aList[0:k]))
    for i in range(1, n-k+1):
        aList_kai.append(np.prod(aList[i:i+k]))
        if aList_kai[i] > aList_kai[i-1]:
            print("Yes")
        else:
            print("No")
else:
    allProduct = np.prod(aList)
    fstHalf = np.prod(aList[:i])
    sndHalf = np.prod(aList[k+i:])
    last = allProduct//fstHalf//sndHalf
    now = 0
    for i in range(1, n-k+1):
        fstHalf = np.prod(aList[:i])
        sndHalf = np.prod(aList[k+i:])
        now = allProduct//fstHalf//sndHalf
        if now > last:
            print("Yes")
        else:
            print("No")
        last = now

Submission status: Runtime Error

Solution code:
import numpy as np
import sys
sys.setrecursionlimit(10**5+10)

N,K = map(int,input().split())
A = list(map(int,input().split()))
ynlist = []

def checker(i):
  try:
    l1 = A[i-K+1:i:]
    b = np.prod(l1)
    i1 = A[i-K]
    i2 = A[i]
    score1 = b * i1
    score2 = b * i2
    if score1 < score2:
      ynlist.append("Yes")
    else:
      ynlist.append("No")
    checker(i + 1)
  except IndexError:
    pass

checker(K)
for i in ynlist:
  print(i)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

def main() :

    n,k = map(int,input().split())
    a_list = [float(i / 1000000) for i in input().split()]

    prev_point = 1
    for i in range(k) :
        prev_point *= a_list[i]

    for i in range(k+1,n+1) :
        # print(i-k,i-1)
        current_point = ((prev_point // a_list[i-k-1]) * a_list[i-1])
        # print(prev_point,current_point)
        if (prev_point < current_point) :
            print("Yes")
        else :
            print("No")
        prev_point = current_point

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import  numpy as np
from functools import reduce
from decimal import *

n, k = map(int, input().split())
a = [ Decimal(x) for x in input().split()]

result = [0]*n
result[k-1] = reduce(lambda x,y:x*y,a[0:k])

for i in range(k, n):
    result[i] = (result[i-1]/a[i-k])*a[i]
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
k=int(input())
re=0
re1=0
su=0
for i in range (k):
    re=re+b*2
    su = su +1
    if (re > a ):
        quit()
for j in range(k-su):
    re1= re1 + c*2
if (re1 > re):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
lst_1=list(map(int,input().split()))
# print(lst_1)
lst_2=[]
for i in range(n-k+1):
    temp=1
    temp=lst_1[i+k]/lst_1[i]
    lst_2.append(temp)
for i in range(len(lst_2)-1):
    if lst_2[i]<lst_2[i+1]:
        print("Yes")
    else:print("No")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*k
for j in range(n-k+1):
  x=1  
  for i in range(j,j+k):
    x*=a[i]
  b[i-1]=x

for m in range(len(b)-1):
  if b[m]<b[m+1]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(0,n-k):
    if a[i]<a[i+n-k-1]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
import  numpy as np
from functools import reduce
from decimal import *

n, k = map(int, input().split())
a = [ Decimal(x) for x in input().split()]

result = [0]*n
result[k-1] = reduce(lambda x,y:x*y,a[0:k])

for i in range(k, n):
    result[i] = result[i-1]*a[i]/a[i-k]
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
Alist=list(map(int,input().split()))
for i in range(0,N):
  if Alist[i]<Alist[i+K]:
    print("Yes")
    i = i + 1
  else:
    print("No")
    i = i + 1

Submission status: Runtime Error

Solution code:
N,K=[int(r) for r in input().split()]
ins=[int(r) for r in input().split()]
sumx=[1]*K
for i in range(K-1,N): 
	for l in ins[i-K+1:i+1]:
	  	sumx[i-K+1] = sumx[i-K+1]*l

for r in range(1,K):
	if sumx[r-1] < sumx[r] :
		print('Yes')
	else:
		print('No')

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
lst = list(map(int, input().split()))

loc = 1

for _ in range(n-k):
    cur = 1
    for i in range(loc, loc+k):
        cur *= lst[i]

    if cur*lst[loc-1] > cur*lst[loc+1]:
        print('Yes')
    else:
        print('No')
    loc += 1

Submission status: Runtime Error

Solution code:
import numpy as np

n,k = map(int,input().split())
a_list = [int(i) for i in input().split()]

# 累積の積
accum_list = (np.cumprod(a_list))

accum_list.insert(0,1)

# print(accum_list)
prev_point = -9999
for i in range(k,n+1) :
    # print(i)
    hoge = accum_list[i]
    fuga = accum_list[i-k]
    current_point = hoge // fuga
    # print(hoge,fuga,current_point,prev_point)
    if (prev_point == -9999) :
        prev_point = current_point
        continue

    if (prev_point < current_point) :
        print("Yes")
    else :
        print("No")
    
    prev_point = current_point

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
n=N-K+1
sum=[0]*n

for i in range(n):
    sum[i]=A[K+i-1]
    for j in range(K-1):
        sum[i]*=A[(K+i-2-j)]
    
for i in range(len(sum)-1):
    if sum[i]>=sum[i+1]:
        print("No")
    else:
        print("Yes

Submission status: Runtime Error

Solution code:
import  numpy as np
from functools import reduce
from decimal import *

n, k = map(int, input().split())
a = [ Decimal(x) for x in input().split()]

result = [0]*n
result[k-1] = reduce(lambda x,y:x*y,a[0:k])

for i in range(k, n):
    result[i] = result[i-1]*a[i]//a[i-k]
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
Alist=list(map(int,input().split()))
for i in range(0,N):
  if Alist[i]<Alist[i+K]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
from functools import reduce
from operator import mul

nk = input().split()
n = int(nk[0])
k = int(nk[1])
a = list(map(int, input().split()))

p = [0] * n
for i in range(k - 1, n):
    if i == k - 1:
        p[i] = reduce(mul, a[i - k + 1:i])
    else:
        p[i] = int(p[i - 1] / a[i - k] * a[i])

for i in range(k - 1, n):
    if i == k - 1:
        continue
    if p[i] > p[i - 1]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import  numpy as np
from functools import reduce
from decimal import *

n, k = map(int, input().split())
a = [ Decimal(x) for x in input().split()]

result = [0]*n
result[k-1] = reduce(lambda x,y:x*y,a[0:k])

for i in range(k, n):
    result[i] = int(result[i-1])*int(a[i])//int(a[i-k])
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N, K= input().split()
N = int(N)
K = int(K)
A = list((input().split()))
         
o = 0
b = list()
c = 0
z = list()
for i in range (K):
    for i in range(len(b)):
        del b[0]
    for i in range(N - K + 1):
        b.append(int(A[c]))
        c = c + 1
    c = o + 1
    o = o + 1
    d = 1
    for i in range (N - K + 1):
        d = d * b[0]
        del b[0]
    z.append(d)
    del A[0]
for i in range(N - K):
    g = int(z[0])
    h = int(z[1])
    if g < h:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

n, k = map(int, input().split())
AA =[]
c =False
for a in input().strip().split():
    a = int(a)
    if not c:
        AA+= [a]
        if len(AA) == k:
            c = True
    else:
        base = AA[0]
        if a - base > 0:
            print("Yes")
        else:
            print("No")
        AA = AA[1:]+[a]

Submission status: Runtime Error

Solution code:
import numpy as np
i = list(map(int, input().split()))
points = np.array(list(map(int, input().split())))
now_point = 0
count = 0
for j in range(i[0]-i[1] + 1):
    frag = False
    a = points[j:j+i[1]].mean()
    k = a * i[1]
    if k > now_point:
        frag = True
    now_point = k
    if count >= 1:
        if frag:
            print("Yes")
        else:
            print("No")
    count += 1

Submission status: Runtime Error

Solution code:
import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)

listS = []

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

for i in range(0,N-K+1):
    if prod(A[i:K+i]) < prod(A[i+1:K+i+1]):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import  numpy as np
from decimal import *
n, k = map(int, input().split())
a = [ Decimal(x) for x in input().split()]

result = [0]*n
result[k-1] =np.prod(a[0:k])

for i in range(k, n):
    result[i] = int(result[i-1])*int(a[i])//int(a[i-k])
    if result[i-1] < result[i]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
import numpy as np

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

l = n - k + 1
lis = [0]*l
#0, 1, 2
for i in range(l):
  z = np.prod(a[i:i+k])
  lis[i] = z
print(lis)
for i in range(n - k):
  if lis[i] < lis[i + 1]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*k
for j in range(n-k+1):
  x=1  
  for i in range(j,j+k):
    x*=a[i]
  b[i-k]=x

for m in range(len(b)-1):
  if b[m]<b[m+1]:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
i = list(map(int,input().split()))
j = list(map(int,input().split()))
for i in range(0, i[0] - i[1]):
    if j[i] < j[i + 3]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
v = []
n = int(input())
m = int(input())
for i in range(0, n):
    ele=int(input())
    v.append(ele)
fact=1
for i in range(0,m):
    fact=fact*v[i]

for i in range(m,n):
    fast=fact
    fact=fact/v[i-m]
    fact=fact*v[i]
    if(fact>fast):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

n = int(input())

AA = [int(a) for a in input().split()]
c = 0
updwn=[None]*(n-1)
for a in AA:
    if c ==0:
        c +=1
        base = a
        continue
    if a - base >= 0:
        updwn[c-1] = True
        base = a
    else:
        updwn[c-1] = False
        base = a
    c += 1
updwn+=[False, False]
base = False
total = 1000
stock = 0
if n ==2:
    if updwn[0]==True:
        total += (total//AA[0])*(AA[1]-AA[0])
else:
    for i in range(n-1):
        if updwn[i] == True and base == False:
            tdcost= AA[i]
            stock = total // tdcost
            base_cost = tdcost
        elif updwn[i] == True and updwn[i+1]==False:
            tdcost=AA[i+1]
            total += (tdcost - base_cost)*stock
            stock = 0
        else:
            pass
        base = updwn[i]
print(total)

Submission status: Runtime Error

Solution code:
import numpy as np

listS = []

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

for i in range(0,N-K+1):
    listS.append(np.prod(A[i:K+i]))
    
for j in range(len(listS)-1):
    if listS[j] < listS[j+1]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
from math import prod
n,k = map(int,input().split())
arr = list(map(int,input().split()))
j = 0
c = prod(arr[j:k])
for i in range(k,n):
    j += 1
    d = prod(arr[j:i+1])
    if d > c:
        print("Yes")
    else:
        print("No")
    c = d

Submission status: Runtime Error

Solution code:

n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(k,n):
  if x[c]<x[i]:
    print('Yes')
  else:print('No')
  c+=1

Submission status: Runtime Error

Solution code:
n=int(input("n?"))
k=int(input("k?"))
a=[int(input("a?")) for i in range(n)]
sei=[0]*(n-k+1)
for i in range(n-k+1):
  for j in range(i,i+k):
    sei[i]+=a[j]

for i in range(n-k):
  if sei[i]<sei[i+1]:
    print("yes")
  else:
    print("no")

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

B = 0
s = 1
for i, a in enumerate(A):
    if i < K:
        s *= a
        B = s
    elif:
        s /= A[i-K]
        s *= a
        if B != 0 and B < s:
            print('Yes')
        elif B != 0 and B >= s:
            print('No')
        B = s

Submission status: Runtime Error

Solution code:
def ip():
  	return list(map(int, input().split()))
[n,k]=ip()
arr=ip()
s=0
e=k
u=k-1
while u:
  if arr[s]<arr[e]:
      print("Yes")
  else:
      print("No")
  s+=1
  u-=1
  e+=1

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))

for i in range(n):
    if a[0]<a[i]:
        up=True
        nin=a[0]
        break
    elif a[0]>a[i]:
        up=False
        break
    if i==n-1:
        print(1000)
        exit()

total=1000

for i in range(1,n-1):
    if up:
        if a[i-1]<=a[i] and a[i]>a[i+1]:
            total+=(total//nin)*(a[i]-nin)
            up=False
    else:
        if a[i-1]>=a[i] and a[i]<a[i+1]:
            nin=a[i]
            up=True
if nin<a[n-1]:
    total+=(total//nin)*(a[n-1]-nin)
print(total)

Submission status: Runtime Error

Solution code:
import bisect,collections,copy,heapq,itertools,math,string,decimal
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
_A = LI()

# A = np.array(_A, dtype='float128')
A = np.array(_A, dtype=decimal.Decimal)

A /= decimal.Decimal(10)
# print(A)

Aprod = np.zeros(N + 1, dtype=np.dtype(decimal.Decimal))
# Aprod = np.zeros(N + 1, dtype='float128')
Aprod[0] = 1
Aprod[1:] = np.cumprod(A)
# print(Aprod)

# print(Aprod)
result = np.zeros(N+1-K,dtype=np.dtype(decimal.Decimal))
# result = np.zeros(N+1-K,dtype='float128')
result = Aprod[K:] / Aprod[0:N+1-K]

# print(result)
ans = []
for i in range(1, N+1-K):
    if result[i] <= result[i-1]:
        ans.append('No')
    else:
        ans.append('Yes')

print('\n'.join(ans))

# 5 3
# 96 98 100000000 100000000 100000000

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] list = new int[n];
        for(int i = 0; i < n; i++) {
            list[i] = sc.nextInt();
        }
        long[] tmp = new long[n];
        tmp[0] = list[0];
        for(int i = 1; i < n; i ++ ) {
            tmp[i] = tmp[i-1]*list[i];
        }
        int l = 0;
        for(int i = 0; i < n - k; i++) {
            long a = tmp[k+i];
            long b = tmp[k-1+i];

            a /= tmp[l];
            tmp[k+i] = a;
            l++;

            if(a > b) {
                System.out.println("Yes");
            } else if(a == b){
                System.out.println("No");
            } else {
                System.out.println("No");
            }
        }
    }
}

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=1
for i in range(K,N):
  for j in range(K):
    B=B*A[0+i-K+j]
  if B*A[i]/A[i-K]>B:
    print ('Yes')
  else:
    print ('No')

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
ans=[a[0]]
ap=a[0]
for i in range(n-1):
    ap*=a[i+1]
    if i>=k-1:
        ans.append(ap/ans[i-k+1])
    else:
        ans.append(ap)
    

for i in range(n-k):
    if ans[i+k-1]>=ans[i+k]:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
memo = {}

tmp = 0
before = 1
for i in range(k):
    tmp = before
    before *= a[i]
memo[k-1][0] = before
memo[k-1][1] = tmp

for i in range(k,n):
    before = memo[i-1][0]
    
    tmp = 0
    after = 1
    for j in range(k):
        tmp = 
        after *= a[i-j]
    
    if before < after:
        print("Yes")
    else:
        print("No")
    
    memo[i] = after

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))

b = 1
for i in A[0:K]:
    b *= i
for i in range(N-K):
    print(A[i+1])
    a = b/A[i+1]*A[i+3]
    print(a)
    if b < a :
        print("Yes")
    else:
        print("No")
    b = a

Submission status: Runtime Error

Solution code:
import numpy as np
n,k = map(int, input().split())
a = np.array([int(i) for i in input().split()])
a = np.concatenate([a,np.ones(k)])
a_ = []
for i in range(1,k):
    a_.append(np.roll(a,i))
a = np.vstack([a,a_])
aa = np.prod(a,axis = 0)
aa = aa[k-1:n]
for i in range(len(aa)-1):
    if aa[i] - aa[i+1] < 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:

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

ai = N-K

for i in range (ai):
    if h[K+i]>h[K+i-1]:
        print('Yes')
    elif h[K+i]==h[K+i-1]:
        print('No')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
from sys import stdin


def readline_from_stdin() -> str:
    return stdin.readline().rstrip


if __name__ == '__main__':
    N, K, = input().split()
    A = [int(i) for i in input().split()]
    N, K = int(N), int(K)

    score = 1
    for i in range(K):
        score *= A[i]

    # scores = [score]
    # for i in range(N-K):
    #     print(i, N-K+i-1)
    #     score = int(score / A[i] * A[N-K+i-1])
    #     scores.append(score)
    #
    # print(scores)
    #
    # results = [False for i in range(len(scores)-1)]
    #
    # for i in range(len(scores)-1):
    #     results[i] = scores[i+1] > scores[i]
    #
    # [print("Yes") if r else print("no") for r in results]

    for i in range(N-K):
        # print(i, N-K+i-1)
        new_score = score / A[i] * A[N-K+i-1]
        if new_score > score:
            print("Yes")
        else:
            print("No")
        score = new_score

Submission status: Runtime Error

Solution code:
N,K=list(map(int,input().split()))

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

ai = N-K

for i in range (ai):
    if h[K+i]>h[K+i-1]:
        print('Yes')
    elif h[K+i]==h[K+i-1]:
        print('No')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
#for _ in range(int(input())):
def zeroPad(numberString, zeros, left = True):
    """Return the string with zeros added to the left or right."""
    for i in range(zeros):
        if left:
            numberString = '0' + numberString
        else:
            numberString = numberString + '0'
    return numberString
def karatsubaMultiplication(x ,y):
    """Multiply two integers using Karatsuba's algorithm."""
    #convert to strings for easy access to digits
    x = str(x)
    y = str(y)
    #base case for recursion
    if len(x) == 1 and len(y) == 1:
        return int(x) * int(y)
    if len(x) < len(y):
        x = zeroPad(x, len(y) - len(x))
    elif len(y) < len(x):
        y = zeroPad(y, len(x) - len(y))
    n = len(x)
    j = n//2
    #for odd digit integers
    if (n % 2) != 0:
        j += 1    
    BZeroPadding = n - j
    AZeroPadding = BZeroPadding * 2
    a = int(x[:j])
    b = int(x[j:])
    c = int(y[:j])
    d = int(y[j:])
    #recursively calculate
    ac = karatsubaMultiplication(a, c)
    bd = karatsubaMultiplication(b, d)
    k = karatsubaMultiplication(a + b, c + d)
    A = int(zeroPad(str(ac), AZeroPadding, False))
    B = int(zeroPad(str(k - ac - bd), BZeroPadding, False))
    return A + B + bd
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=karatsubaMultiplication(ans[i-1],x[i])/x[c]
  if ans[i]>ans[i-1]:
    print('Yes')
  else:print('No')
  c+=1
#for _ in range(int(input())):
def zeroPad(numberString, zeros, left = True):
    """Return the string with zeros added to the left or right."""
    for i in range(zeros):
        if left:
            numberString = '0' + numberString
        else:
            numberString = numberString + '0'
    return numberString
def karatsubaMultiplication(x ,y):
    """Multiply two integers using Karatsuba's algorithm."""
    #convert to strings for easy access to digits
    x = str(x)
    y = str(y)
    #base case for recursion
    if len(x) == 1 and len(y) == 1:
        return int(x) * int(y)
    if len(x) < len(y):
        x = zeroPad(x, len(y) - len(x))
    elif len(y) < len(x):
        y = zeroPad(y, len(x) - len(y))
    n = len(x)
    j = n//2
    #for odd digit integers
    if (n % 2) != 0:
        j += 1    
    BZeroPadding = n - j
    AZeroPadding = BZeroPadding * 2
    a = int(x[:j])
    b = int(x[j:])
    c = int(y[:j])
    d = int(y[j:])
    #recursively calculate
    ac = karatsubaMultiplication(a, c)
    bd = karatsubaMultiplication(b, d)
    k = karatsubaMultiplication(a + b, c + d)
    A = int(zeroPad(str(ac), AZeroPadding, False))
    B = int(zeroPad(str(k - ac - bd), BZeroPadding, False))
    return A + B + bd
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=karatsubaMultiplication(ans[i-1],x[i])/x[c]
  if ans[i]>ans[i-1]:
    print('Yes')
  else:print('No')
  c+=1

Submission status: Runtime Error

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

shaku = []

for i in range(n-k+1):
    start = i
    end = start + k
    h = a[start] * a[start+1]
    now = start + 2
    while now < end:
        if (0 in a[now:end]):
            h = 0
            break

        h *= a[now]
        now += 1

    shaku.append(h)

for i in range(len(shaku)-1):
    if (shaku[i] < shaku[i+1]):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
for i in range(K, N):
    if A[i-2]*A[i-1]*A[i-3] > A[i-4]*A[i-3]*A[i-2]:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
a = list(map(int,input().split()))

ans = []
g = 0
for i in range(K):
  k = 1
  for s in range(K):
    k += a[s+i] 
  ans.append(k)
  if len(ans)>1:
    if ans[g]<ans[g+1]:
      print("Yes")
    else:
      print("No")
    g+=1

Submission status: Runtime Error

Solution code:
import numpy as np
n,k = map(int,input().split())

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

a_sum = [0 for _ in range(n+1)]
a_sum[0] = 1


a_sum[1:] = np.cumprod(a)
#print(a_sum)

score = [0 for _ in range(n-k+1)]

for i in range(k,n+1):
    score[i-k] = int(a_sum[i]/a_sum[i-k])

#print(score)

for i in range(1,n-k+1):
    if(score[i] > score[i-1]):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
ans=[a[0]]
ap=a[0]
for i in range(n-1):
    ap*=a[i+1]
    if i>=k-1:
        ans.append(ap/ans[i-k+1])
    else:
        ans.append(ap)
    
com=ans[k-1]

for i in range(n-k):
    if ans[i+k-1]>=ans[i+k]:
        print("No")
    else:
        print("Yes")
    com=ans[i+k]/ans[i]

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
ar=list(map(int,input().split()))
for i in range(k,n):
	if ar[i]>ar[i-k]:
		print("Yes")
	else:
		print("No"

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = [0]*(k+2)
ans[0] = 1
for i in range(k):
    ans[0] *= a[i]
print(ans[0])
for i in range(n-k):
    #print(i,ans)
    ans[i+1] = ans[i] * a[i+k] //a[i]
    if ans[i+1] > ans[i]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:

import numpy as np

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

for i in range(K, N+1):
    sum_prod = np.prod(A[i-K:i])
    if i > K:
        if sum_prod > tmp_sum_prod:
            print('Yes')
        else:
            print('No')
    tmp_sum_prod = sum_prod

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
score = 1
for i in range(k-1, n-1):
    if int(score) < int(score*a[i+1]/a[i-k+1]):
        print('Yes')
    else:
        print('No')
    score = score*a[i+1]/a[i-k+1]

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = []
for i in range(k,n+1):
  c = a[i-k:i+1]
  d = 1
  for j in range(k):
    d *= c[j]
  b.append(d)
for i in range(len(d)-1):
  if d[i+1]-d[i] > 0:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
import numpy as np
n,k = map(int,input().split())

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

a_sum = [0 for _ in range(n+1)]
a_sum[0] = 1


a_sum[1:] = np.cumprod(a)
#print(a_sum)

score = [0 for _ in range(n-k+1)]

for i in range(k,n+1):
    score[i-k] = int(a_sum[i]/a_sum[i-k])

#print(score)

for i in range(1,n-k+1):
    if(score[i] > score[i-1]):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import functools
import operator
import numpy as np

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

# prod = functools.partial(functools.reduce, operator.mul)
for i in range(K, N+1):
    sum_prod = np.prod(A[i-K:i])
    if i > K:
        if sum_prod > tmp_sum_prod:
            print('Yes')
        else:
            print('No')
    tmp_sum_prod = sum_prod

Submission status: Runtime Error

Solution code:
import operator
import functools
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = [0]*(k+2)
seki = functools.partial(functools.reduce, operator.mul)
ans[0] = seki(a[:k])
for i in range(n-k):
    #print(i,ans)
    ans[i+1] = ans[i] * a[i+k]
    ans[i+1] //= a[i]
for i in range(n-k):
    if ans[i+1] > ans[i]:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

hyouten = []


for i in range(n-k+1):

    
    if i>0:
        score_old = a[i-1]
        score = a[i+k-1]
#        print(score_old,score)
        if score >score_old:
            print("Yes")
        else:
            print("No")
    hyouten.append(score)

Submission status: Runtime Error

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

shaku = []

for i in range(n-k+1):
    start = i
    end = start + k
    h = a[start] * a[start+1]
    now = start + 2
    while now < end:
        h *= a[now]
        now += 1

    shaku.append(h)

for i in range(len(shaku)-1):
    if (shaku[i] < shaku[i+1]):
        print("Yes")
    else:
        print("No")