Harryxun/stf_run huggingface dataset:
def main():
    n = int(input())
    inlis = []
    namelis = []
    for i in range(n):
        a, b = map(str, input().split())
        b = int(b)
        inlis.append([a,b])
        namelis.append(a)
    namelis.sort()    
    inlis_so = sorted(inlis)
    k = 0
    anslis = []
    for num in inlis:
        #print(num, num[0], inlis_so, inlis_so.count(num[0]))
        kazu = namelis.count(num[0])
        if kazu == 1:
            anslis.append(inlis_so.index(num))
        else:
            kijun = namelis.index(num[0])+1
            kouho = list(filter(lambda word:True if word[0] == num[0] else False,inlis))
            kouho_so = sorted(kouho, key = lambda x:x[1], reverse = True)
            suujibun = kouho_so.index(num)
            #print(kouho, kouho_so, kijun, suujibun)
            anslis.append(kijun + suujibun)
    for i in range(1, n+1):
        print(anslis.index(i)+1)

    

        
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    inlis = []
    namelis = []
    for i in range(n):
        a, b = map(str, input().split())
        b = int(b)
        inlis.append([a,b])
        namelis.append(a)
    namelis.sort()    
    inlis_so = sorted(inlis)
    anslis = []
    for num in inlis:
        #print(num, num[0], inlis_so, inlis_so.count(num[0]))
        kazu = namelis.count(num[0])
        if kazu == 1:
            anslis.append(inlis_so.index(num)+1)
        else:
            kijun = namelis.index(num[0]) + 1
            kouho = list(filter(lambda word:True if word[0] == num[0] else False,inlis))
            kouho_so = sorted(kouho, key = lambda x:x[1], reverse = True)
            suujibun = kouho_so.index(num)
            anslis.append(kijun + suujibun)
    for i in range(1, n+1):
        #print(anslis)
        print(anslis.index(i)+1)

    

        
    
if __name__ == "__main__":
    main()
A = list(map(int,input().split()))
for i in range(A[2]):
    if A[0] > 0:
        A[0] -= 1
    elif A[1] > 1:
        A[1] -=1
print(A[0],A[1])


### FIXED CODE ###

S,T= map(str,input().split())
print(T+S)
while True:
    x = int(input().strip())
    if x == 0:
        break
    print "Case %d : %d" % (i,x)

### FIXED CODE ###

i = 1
while True:
    x = int(input().strip())
    if x == 0:
        break
    else:
        print ("Case {}: {}".format(i,x))
        i += 1
import sys
input = sys.stdin.readline

def li():
    return [int(x) for x in input().split()]

N = int(input())
A = li()

A.sort(reverse=True)

B = [A[i] for i in range(N) if i < N//2]

# 9 8 7 6 5
# 9 1 8 2 7 3 6 4 5
# 9 6 8 7
# 9+8+7+6+5+6+7+8

# 8 7 6 5
# 8 1 7 2 6 3 5 4
# 8+7+6+5+5+6+7

sm = B[0] + sum(B[i] * 2 for i in range(N/2) if 0 < i)
print(sm)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def li():
    return [int(x) for x in input().split()]

N = int(input())
A = li()

A.sort(reverse=True)

B = [A[i] for i in range(N) if i < N//2]

# 9 8 7 6 5
# 9 1 8 2 7 3 6 4 5
# 9 6 8 7
# 9+8+8+7+7+6+6+5

# 8 7 6 5
# 8 1 7 2 6 3 5 4
# 8+7+6+5+5+6+7

if N % 2 == 1:
    B = [A[i] for i in range(N) if i < N // 2 + 1]
    sm = B[0] + B[-1] + sum(B[i]*2 for i in range(N//2) if 0 < i)
    print(sm)
else:
    sm = B[0] + sum(B[i]*2 for i in range(N//2) if 0 < i)
    print(sm)
AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
                return
        else:
            if S[i] != "-":
                flag = False
                return

if flag:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

AB = input()
S = input()

A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])

ints = "0123456789"


flag = True

if len(S) != A + B + 1:
    flag = False

if flag:
    for i in range(len(S)):
        if i != A:
            if not(S[i] in ints):
                flag = False
        else:
            if S[i] != "-":
                flag = False

if flag:
    print("Yes")
else:
    print("No")
from collections import deque
    
N = int(input())
A = deque(list(map(int, input().split())))

gcd_max=1

import functools
import math

for i in range(N):
    a = A.popleft()
    gcd_max = max(gcd_max, functools.reduce(math.gcd, A))
    A.append(a)

print(gcd_max)


### FIXED CODE ###

from collections import deque
from copy import copy
from array import array

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

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

def get_prefix_gcd_list(Adeque):
    prefix_gcd = array('i', [0]*N)
    # marker
    prefix_gcd[0] = 0
    # the first itself is gcd
    prefix_gcd[1] = Adeque.popleft()
    for i in range(2,N):
        a = Adeque.popleft()
        prefix_gcd[i] = gcd(prefix_gcd[i-1], a)
        pass
    return prefix_gcd
        
    
# PREFIX_GCD[i]...i より前の要素のGCD
PREFIX_GCD = get_prefix_gcd_list(deque(copy(A)))

# PREFIX_GCD[i]...i より後の要素のGCD
POSTFIX_GCD=list(reversed(get_prefix_gcd_list(deque(reversed(A)))))

gcd_max=1

for i in range(N):
    pre = PREFIX_GCD[i]
    pos = POSTFIX_GCD[i]
    if pre == 0:
        _gcd = pos
    elif pos == 0:
        _gcd = pre
    else:
        _gcd = gcd(pre,pos)
    gcd_max = max(gcd_max, _gcd)
        
print(gcd_max)
N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
     
    Asum = [0]
    Bsum = [0]
    atemp = 0
    btemp = 0
    for i in range(N):
        atemp += A[i]
        Asum.append(atemp)
    for i in range(M):
        btemp += B[i]
        Bsum.append(btemp)
     
    ans = 0
    j = M
    for i in range(N+1):
        if Asum[i] > K:
            break
        while Asum[i] + Bsum[j] > K:
            j -= 1
        ans = max(ans, i+j)
     
    print(ans)

### FIXED CODE ###

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

Asum = [0]
Bsum = [0]
atemp = 0
btemp = 0
for i in range(N):
    atemp += A[i]
    Asum.append(atemp)
for i in range(M):
    btemp += B[i]
    Bsum.append(btemp)

ans = 0
j = M
for i in range(N+1):
    if Asum[i] > K:
        break
    while Asum[i] + Bsum[j] > K:
        j -= 1
    ans = max(ans, i+j)

print(ans)
from heapq import heappop as pop, heappush as push

peak, curr = 0, 0

stuff = []
n, c = map(int, raw_input().split())
for _ in xrange(n):
  stuff.append(map(float, raw_input().split()))
  
stuff = sorted(stuff)
has_camera = [False] * c
ending = []
for st, end, ch in stuff:
  while ending[0][0] <= st - 0.5:
    _, cch = pop(ending)
    has_camera[cch] = False
    curr -= 1
  if not has_camera[ch]:
    curr += 1
  push(ending, (end, ch))
  peak = max(peak, curr)
  
 print peak

### FIXED CODE ###

from heapq import heappop as pop, heappush as push

peak, curr = 0, 0

stuff = []
n, c = map(int, raw_input().split())
for _ in xrange(n):
  stuff.append(map(float, raw_input().split()))
  stuff[-1][-1] = int(stuff[-1][-1]) - 1
  
stuff = sorted(stuff)
has_camera = [False] * c
last_ending = [-1] * c
ending = []
for st, end, ch in stuff:
  while ending and ending[0][0] <= st - 0.5:
    cend, cch = pop(ending)
    if last_ending[cch] == cend:
        has_camera[cch] = False
        curr -= 1
  if not has_camera[ch]:
    has_camera[ch] = True
    curr += 1
  push(ending, (end, ch))
  last_ending[ch] = end
  peak = max(peak, curr)
  
print peak
a, b, c, d = map(int, input().split())
a //= d
c //= a
print("Yes" if a >= c else "No")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
print("Yes" if (a + d - 1) // d >= (c + b - 1) // b else "No")
while True:
    n, m, a = map(int, input().split())
    if n == 0: break
    ls = [[0 for i in range(n+1)] for i in range(m)]
    print(ls)
    for i in range(m):
        h, p, q = map(int, input().split())
        ls[h][p] = 1
    ls.reverse()
    print(ls)
    for t in ls:
        if t[a] == 1:
            a += 1
        elif t[a-1] == 1:
            a -= 1
    print(a)

### FIXED CODE ###

while True:
    n, m, a = map(int, input().split())
    if n == 0: break
    ls = [[0 for i in range(n+1)] for i in range(1001)]
    for i in range(m):
        h, p, q = map(int, input().split())
        ls[h][p] = 1
    ls.reverse()
    for t in ls:
        if t[a] == 1:
            a += 1
        elif t[a-1] == 1:
            a -= 1
    print(a)
import sys
for i, j in sys.stdin:
    print i + j

### FIXED CODE ###

import sys
for inp in sys.stdin:
    i, j = map(int, inp.split())
    print i + j
import numpy as np
N, X, Y = map(int, input().split())
dist = [0] * (N + 1)
cnt = [0] * (N + 1)

d = [[abs(j - i) for j in range(N)] for i in range(N)]
d[X - 1][Y - 1] = 1
d[Y - 1][X - 1] = 1


def warshall_floyd(d):
    #d[i][j]: iからjへの最短距離
    # for k in range(N):
    #     for i in range(N):
    #         for j in range(N):
    #             d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    # return d
    return [min(d[i][j], d[i][k] + d[k][j]) for k in range(N) for i in range(N) for j in range(N):]
                

d = warshall_floyd(d)
count = np.bincount(np.array(d).flatten(), minlength=N)
count = count[1:] // 2
print(*count, sep='\n')


### FIXED CODE ###

N, X, Y = map(int, input().split())


def f(i, j):
    v1 = j - i
    v2 = abs(X - i) + 1 + abs(j - Y)
    v3 = abs(Y - i) + 1 + abs(j - X)
    return min(v1, v2, v3)


D = [0] * N
for i in range(1, N):
    for j in range(i + 1, N + 1):
        d = f(i, j)
        D[d] += 1

for d in D[1:]:
    print(d)
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
	
def main():
	N, K = map(int, input().split(" "))
	V = list(map(int, input().split(" ")))
	
	ans = 0
	for L in range(K+1):
		for R in range((K+1)-L):
			gets = []
			tmp = 0
			
			for i in range(L):
				tmp += V[i]
				if V[i] < 0:
					gets.append(V[i])
					
			for i in range(R):
				tmp += V[-(i+1)]
				if V[-(i+1)] < 0:
					gets.append(V[-(i+1)])
					
			#print(gets)
			for i in range(K-L-R):
				if len(gets) == 0:
					break
				gets.sort()
				tmp = tmp + (-1 * gets.pop(0))
				
			if tmp > ans:
				ans = tmp
				
	print(ans)
	
	
	
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
	
def main():
	N, K = map(int, input().split(" "))
	V = list(map(int, input().split(" ")))
	
	V_tmp = copy.deepcopy(V)
	ans = 0
	for L in range(K+1):
		for R in range((K+1)-L):
			V = copy.deepcopy(V_tmp)
			gets = []
			tmp = 0
			
			for i in range(L):
				if len(V) > 0:
					tmptmp = V.pop(0)
					tmp += tmptmp
					if tmptmp < 0:
						gets.append(tmptmp)
					
			for i in range(R):
				if len(V) > 0:
					tmptmp = V.pop(-1)
					tmp += tmptmp
					if tmptmp < 0:
						gets.append(tmptmp)
					
			#print(gets)
			for i in range(K-L-R):
				if len(gets) == 0:
					break
				gets.sort()
				tmp = tmp + (-1 * gets.pop(0))
				
			if tmp > ans:
				ans = tmp
				
	print(ans)
	
	
	
if __name__ == "__main__":
	main()
r = int(input())
print(r**2

### FIXED CODE ###

r = int(input())
print(r**2)
import sys
veces= list()
lines = sys.stdin.readlines()
for linea in lines:
    c = linea.split()
    c = list(map(int,c))
list(c)

rango = range(c[0],c[1]+1)
j = list(rango)
for l in range(len(j)):
  division = j[l]%c[2]
  if division == 0:
    veces.append(division)

print(int(len(veces)))    

### FIXED CODE ###

a, b, x = [int(x) for x in input().split()]
print(b // x - (a - 1) // x)
n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c=[]
ac = 0
bc = 0
ans = 0
t = 0
while t<k:
  if bc<=m-1 and ac <=n-1:
    if a[ac] > b[bc]:
      t += b[bc]
      bc +=1
      c.
    else:
      t+= a[ac]
      ac+=1
  elif ac >= n and bc<=m-1:
    t += b[bc]
    bc +=1
    print(t)
  elif bc == m and ac<=n-1:
    t+= a[ac]
    ac+=1
  ans+=1

if t>k:
  ans -=1
  
print(ans)

### FIXED CODE ###

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
import math
n = int(input())
ans = math.factorial(n) % (1e9+7)
print(int(ans))

### FIXED CODE ###

import math
n = int(input())
ans = math.factorial(n) % (10**9+7)
print(int(ans))
n=int(input())
A=list()
ans=''
while n>=26:
    s=n%26
    n=n//26
    ans+=(chr(s+96))
ans+=(chr(n+96))
print(ans)

### FIXED CODE ###

a=input()
   
if str.isupper(a):
    print("A")
else:
    print("a")
import numpy as np
import sympy

N = int(input())
A = list(map(int, input().split()))
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
mod = np.array([[-1 for i in range(N)] for i in range(N)])

count = 0
for i in range(N):
    buf = sympy.divisors(A[i])
    if len(set(A) - set(buf)) == N-1:
        count += 1

#count = 0
#for i in range(N):
#        mod[i] = np.mod(A,A[i])
#for i in range(N):
#    c = list(mod[:,i]).count(0)
#    if c == 1:
#        count += 1
#        
print(count)

### FIXED CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
A.sort()#わるほう

#kouho = sorted([x for x in set(A) if A.count(x) == 1])
#maxA = 10**5

#target = kouho[:]
maxA = A[-1]
work=[0]*(A[-1]+1)

for i in range(len(A)):
    if work[A[i]]<=1:
        maxN = int(maxA/A[i])
        for n in range(1,maxN+1):
            buf = A[i]*n
            #remove_list.append(buf)
            work[buf]+=1
                #print(A[i]*n)

#target = kouho[:]
#kouho = list(set(kouho) - set(remove_list))

sm=0
for s in A:
    if work[s]==1: sm+=1
print(sm)

#print(len(kouho))
import itertools

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

r = 1
for i in range(n):
    r *= i + 1

d = []
for j in range(n - 1):
    for k in range(j + 1, n):
        d.append(((x[j][0] - x[k][0]) ** 2 + (x[j][1] - x[k][1]) ** 2) ** 0.5 / r)

p = list(itertools.permutations(d, n - 1))

ans = []
for l in range(r):
    ans.append(sum(list(p[l])))
        
print(sum(ans))

### FIXED CODE ###

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

d = 0
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        d += ((x[i][0] - x[j][0]) ** 2 + (x[i][1] - x[j][1]) ** 2) ** 0.5
        cnt += 1

print(d * (n - 1) / cnt)
import sys

for line in sys.stdin.readlines():
  a, b = map(int, line.split())

print('{0} {1}'.format(a*b, 2a+2b))

### FIXED CODE ###

import fileinput

for line in fileinput.input():
  a, b = map(int, line.strip().split())

print('{0} {1}'.format(a*b, (2*a)+(2*b)))
from fractions import*;from functools import*;n,x,*a=map(int,open(0).read().split());print(reduce(gcd,[abs(x-i)for i in a]))

### FIXED CODE ###

a,b=map(int,input().split());print("YNeos"[a*b%2!=1and 3*a*b%2!=1::2])
N = int(input())
lia=[int(it) for it in input().split()]
lib=[int(it) for it in input().split()]
lip=[lia[i]-lib[i] for i in range(N)]
sb = 0
for i in range(N):
  if (lip[i]>0):
    sb+=lip[i]
sa2 = 0
for i in range(N):
  if (lip[i]<0):
    sa2=(-lip[i])//2
sas-=sb*2
x = sum(lib)-sum(lia)
if (x<0):
  print ("No")
else:
  if (sa2>=sb):
    print ("Yes")
  else:
    print ("No")


### FIXED CODE ###

N = int(input())
lia=[int(it) for it in input().split()]
lib=[int(it) for it in input().split()]
lip=[lia[i]-lib[i] for i in range(N)]
sb = 0
for i in range(N):
  if (lip[i]>0):
    sb+=lip[i]
sa2 = 0
for i in range(N):
  if (lip[i]<0):
    sa2+=(-lip[i])//2
x = sum(lib)-sum(lia)
if (x<0):
  print ("No")
else:
  if (sa2>=sb):
    print ("Yes")
  else:
    print ("No")
import sys
n ,k = map(int, input().split())
m = 0

if n == k or k == 1:
    print(0)
    sys.exit()
    
def abs_N(n, k):
    m = abs(n-k)
    compare_N_M(n, m)

def compare_N_M(n, m):
    if m == 1:
        print(1)
        sys.exit()
    elif n >= m:
        n = m
        abs_N(n, k)
    else:
        print(n)
        sys.exit()
        

abs_N(n, k)


### FIXED CODE ###

import sys
n ,k = map(int, input().split())
if n == k or k == 1:
    print(0)
    sys.exit()
else:
    n %= k
print(min(n, abs(n-k)))
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    a, b = map(int, raw_input().split())
    print len(str(a+b))

### FIXED CODE ###

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

import sys

for line in sys.stdin:
    a, b = map(int, line.split())
    print len(str(a+b))
x,y=map(int,input().split())
if x=y:
  result=0
elif y>x:
  if x<=0 and y>=0 and (x+y)/2>=0:
    result=y-abs(x)+1
  else:
    result=y-x
elif x>=y:
  if y>=0:
    result=y+x+1 
  elif x<=0:
    result=x-y+2
  else:
    result=abs(abs(x)-abs(y))+1
  
print(result)

### FIXED CODE ###

x,y=map(int,input().split())
if x==y:
  result=0
elif y>x:
  if x<0 and y>0:
    result=abs(abs(y)-abs(x))+1
  else:
    result=y-x
elif x>y:
  if x<0:
    result=x-y+2
  else:
    if y>0:
      result=x-y+2
    else:
      result=abs(abs(x)-abs(y))+1
  
print(result)
n, m = list(map(int, input().split()))
    if n==m:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

n, m = list(map(int, input().split()))
if n==m:
    print("Yes")
else:
    print("No")
if __name__ == '__main__':
    x = input()
    a = x.split(' ')[0]
    b = x.split(' ')[1]

    if a > b:
        print('a > b')
    elif a < b:
        print('a < b')
    else:
        print('a == b')


### FIXED CODE ###

line = int(input())

h = int(line / 3600)

m = int(line % 3600 / 60)

s = int(line % 3600 % 60)

print(str(h) + ':' + str(m) + ':' + str(s))
#!/usr/bin/env python3

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

if A == 0:
    print(0)
elif B == 0:
    print(N)
elif A + B == N or A + B > N and N >= A:
    print(A)
else A + B > N and N < A:
    print(N)
else:
    r = int(N / (A+B))
    q = N % (A+B)
    print(r * A + q)


### FIXED CODE ###

#!/usr/bin/env python3

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

if A == 0:
    print(0)
elif B == 0:
    print(N)
elif A + B == N:
    print(A)
elif A + B > N and N >= A:
    print(A)
elif A + B > N and N < A:
    print(N)
# 8 10 4
# bbbbbbbb bbrrrr
else:
    r = int(N / (A+B))
    q = N % (A+B)
    if (q <= A):
        print(r * A + q)
    else:
        print(r * A + A)

# 8 1 4
# brrrrbrr rr

# -----
# 8 4 2
# bbbbrrbb bb

# 13 4 2
# bbbb rr bbbb rr b

# 2 4 2
# bb

# r = N / (A+B)
# q = N % (A+B)
# r * A + q
N, P = map(int, input().split())
if N == 1:
    print(P)
    exit()
if int(P ** (1 / N)) < 2:
    print(1)
print(int(P ** (1 / N)) + 10)
for n in range(int(P ** (1 / N))+1, 0, -1):
    if P % (n ** N) == 0:
        print(n)
        break

### FIXED CODE ###

N, P = map(int, input().split())
if N == 1:
    print(P)
    exit()
if int(P ** (1 / N)) < 2:
    print(1)
    exit()
for n in range(int(P ** (1 / N))+1, 0, -1):
    if P % (n ** N) == 0:
        print(n)
        break
import math
#----エラトステネスの篩--------
def get_primenumber(number):
    prime_list = []
    #2からnumberまでの数字をsearch_listに入れる
    prime_2007=[]
    j=0
    lr=[0]
    cnt=0

    search_list = list(range(2,number+1))
    while True:
      #search_listの先頭の値が√nの値を超えたら処理終了
      if search_list[0] > math.sqrt(number):
        #prime_listにsearch_listを結合
        prime_list.extend(search_list)
        break
      else:
        #search_listの先頭をprime_listに入れる
        head_num = search_list[0]
        prime_list.append(head_num)

        #search_listの先頭をpopする
        search_list.pop(0)
        #head_numの倍数を取り除く
        search_list = [num for num in search_list if num % head_num != 0]
    
    for item in prime_list:
        if (item+1)//2 in prime_list:
            prime_2007.append(item)

    for item in prime_2007:
        lr+=[cnt]*(item - j-1)
        cnt+=1
        j=item
        lr.append(cnt)
    #print(prime_2007)
    #print(lr)
    #return prime_list
    return(lr)


lrlr=get_primenumber(10**5+10)

result=[]
n=int(input())
for i in range(n):
    l,r=map(int,input().split())
    #l=min(l,len(lrlr)-1)
    #r=min(r,len(lrlr)-1)
    #print(l,r)
    #print(len(lrlr))

    result.append(lrlr[r]-lrlr[l-1])

for item in result:
    print(item)


### FIXED CODE ###

import math
#----エラトステネスの篩--------
def get_primenumber(number):
    prime_list = []
    #2からnumberまでの数字をsearch_listに入れる
    prime_2007=[]
    j=0
    lr=[0]
    cnt=0

    search_list = list(range(2,number+1))
    while True:
      #search_listの先頭の値が√nの値を超えたら処理終了
      if search_list[0] > math.sqrt(number):
        #prime_listにsearch_listを結合
        prime_list.extend(search_list)
        break
      else:
        #search_listの先頭をprime_listに入れる
        head_num = search_list[0]
        prime_list.append(head_num)

        #search_listの先頭をpopする
        search_list.pop(0)
        #head_numの倍数を取り除く
        search_list = [num for num in search_list if num % head_num != 0]
    
    for item in prime_list:
        if (item+1)//2 in prime_list:
            prime_2007.append(item)

    for item in prime_2007:
        lr+=[cnt]*(item - j-1)
        cnt+=1
        j=item
        lr.append(cnt)
    lr+=[cnt]*(10**5-j)
    #print(prime_2007)
    #print(lr)
    #return prime_list
    return(lr)


lrlr=get_primenumber(10**5+10)

result=[]
n=int(input())
for i in range(n):
    l,r=map(int,input().split())
    #l=min(l,len(lrlr)-1)
    #r=min(r,len(lrlr)-1)
    #print(l,r)
    #print(len(lrlr))

    result.append(lrlr[r]-lrlr[l-1])

for item in result:
    print(item)
N = int(input())

if N % 2 == 0:
  print(N//2,N,N)
else:
  for h in range(2,3501,2):
    for n in range(2,3501,2):
      w = h*n*N/(4*h*n-n*N-h*N)
      if w > 0 and w.is_integer():
        print(h,n,int(w))
        exit()


### FIXED CODE ###

N = int(input())

if N % 2 == 0:
  print(N//2,N,N)
else:
  for h in range(2,3501,2):
    for n in range(2,3501,2):
      if 4*h*n-n*N-h*N != 0:
        w = h*n*N/(4*h*n-n*N-h*N)
        if w > 0 and w.is_integer():
          print(h,n,int(w))
          exit()
s = input()
i = 0
while s[i] != 'A':
  i += 1
s.reverse()
j = 0
while s[j] != 'Z':
  j += 1
print(j-i+1)

### FIXED CODE ###

s = input()
a = s.find('A')
b = s.rfind('Z')
print(b-a+1)
def run(N, A):
    r = 0
    A_sum = 0
    A_xor = 0
    A_and = 0
    r = -1
    cnt = 0
    for l in range(N):
        while (A_sum - A_xor == 2*A_and) and r < N-1:
            r += 1
            A_sum += A[r]
            A_xor ^= A[r]
            A_and &= A[r]
        if A_sum - A_xor == 2*A_and:
            cnt += r - l + 1
        else:
            cnt += r - l
        '''
        元に戻す
        xor:
        0 0 => 0
        0 1 => 1
        1 0 => 1
        1 1 => 0
        '''
        A_sum -= A[l]
        A_xor ^= A[l]
        A_and = 2*(A_sum - A_xor)
    return cnt


def main():
    N = int(input())
    A = map(int, input().split())
    print(run(N, A))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def run(N, A):
    r = 0
    A_sum = 0
    A_xor = 0
    A_and = 0
    r = -1
    cnt = 0
    for l in range(N):
        while (A_sum - A_xor == 2*A_and) and r < N-1:
            r += 1
            A_sum += A[r]
            A_xor ^= A[r]
            A_and &= A[r]
        if A_sum - A_xor == 2*A_and:
            cnt += r - l + 1
        else:
            cnt += r - l
        '''
        元に戻す
        xor:
        0 0 => 0
        0 1 => 1
        1 0 => 1
        1 1 => 0
        '''
        A_sum -= A[l]
        A_xor ^= A[l]
        A_and = 2*(A_sum - A_xor)
    return cnt


def main():
    N = int(input())
    A = list(map(int, input().split()))
    print(run(N, A))


if __name__ == '__main__':
    main()
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")


### FIXED CODE ###

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