Harryxun/stf_run huggingface dataset:
def lrCount(rCount,lCount,ansList,i):
    count = rCount + lCount
    c = 0
    if i == len(s) - 1:
        c = 1
    if count % 2 == 0:
        ansList[i - lCount + c] = count // 2
        ansList[i - lCount - 1 + c] = count // 2
    else:
        if rCount % 2 == 1:
            ansList[i - lCount + c] = count // 2
            ansList[i - lCount - 1 + c] = count // 2 + 1
        else:
            ansList[i - lCount + c] = count // 2 + 1
            ansList[i - lCount - 1 + c] = count // 2


s = input()
check = "N"
ansList = [0 for i in range(len(s))]

for i in range(len(s)):
    if check == "N":
        count = 0
        check = "R"
        rCount = 1
        
    else:
        if s[i] == check and i != len(s) - 1:
            if s[i] == "R":
                rCount += 1
            else:
                lCount += 1
        elif i == len(s) - 1:
            lCount += 1
            lrCount(rCount,lCount,ansList,i)
        else:
            if s[i] == "L":
                check = "L"
                lCount = 1
            if s[i] == "R":                
                lrCount(rCount,lCount,ansList,i)
                check = "R"
                rCount = 1
                count = 0

for i in range(len(ansList)):
    if i == 0:
        ans = str(ansList[0])
    else:
        ans = ans + " " + str(ansList[i])

print(ans)

### FIXED CODE ###

def lrCount(rCount,lCount,ansList,i):
    count = rCount + lCount
    c = 0
    if i == len(s) - 1:
        c = 1
    if count % 2 == 0:
        ansList[i - lCount + c] = count // 2
        ansList[i - lCount - 1 + c] = count // 2
    else:
        if rCount % 2 == 1:
            ansList[i - lCount + c] = count // 2
            ansList[i - lCount - 1 + c] = count // 2 + 1
        else:
            ansList[i - lCount + c] = count // 2 + 1
            ansList[i - lCount - 1 + c] = count // 2

import sys

s = input()

if s == "RL":
    print("1 1")
    sys.exit()

check = "N"
ansList = [0 for i in range(len(s))]

for i in range(len(s)):
    if check == "N":
        count = 0
        check = "R"
        rCount = 1
        
    else:
        if s[i] == check and i != len(s) - 1:
            if s[i] == "R":
                rCount += 1
            else:
                lCount += 1
        elif i == len(s) - 1:
            if s[i-1] == "R":
                lCount = 1
            else:
                lCount += 1
            lrCount(rCount,lCount,ansList,i)
        else:
            if s[i] == "L":
                check = "L"
                lCount = 1
            if s[i] == "R":                
                lrCount(rCount,lCount,ansList,i)
                check = "R"
                rCount = 1
                count = 0

for i in range(len(ansList)):
    if i == 0:
        ans = str(ansList[0])
    else:
        ans = ans + " " + str(ansList[i])

print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n]+a[0]

print(max(ans,c))

### FIXED CODE ###

k,n=map(int,input().split())
a=list(map(int,input().split()))
ans=0
for x in range(n-1):
  b=a[x+1]-a[x]
  ans=max(ans,b)
  
c=k-a[n-1]+a[0]

print(k-max(ans,c))
from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in range(N):
    print(my_count[i][1])

### FIXED CODE ###

from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(1, N + 1):
    my_count[i] = 0
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in range(N):
    print(my_count[i][1])
def main():
    N, M = list(map(int,input().split())
    if N == M:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N, M = list(map(int,input().split()))
    if N == M:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))
n= int(input())
a = list(map(int,input().split()))
now = a[0] 
a.sort()
res = 0
ans = 1
for i in range(n-1):
    if a[i+1] != now:
        ans+=1
        now = a[i+1]
if ans%2:print(ans)
else: print(ans-1)

### FIXED CODE ###

n,m = map(int,input().split())
s = input()
cnt = [0]*(n+1)
r = n
for i in range(n-1,-1,-1):
    if s[i] == '1':
        cnt[i] = -1
        continue
    while r > i+m:r -=1
    while cnt[r] == -1:r -= 1
    if i == r:
        print(-1)
        exit(0)
    cnt[i] =cnt[r]+1
now = 0
ans = []
for i in range(n+1):
    if cnt[i] == -1:continue
    if cnt[i] == cnt[now]-1:
        ans.append(i-now)
        now = i
print(*ans)
S = int(input())
mod = 10**9+7

table = [1]*(S+1)
table[0] = 0
table[1] = 0
table[2] = 0

for s in range(6,S+1):
    for i in range(3,s-2):
        table[s] += table[i]
        table[s] %= mod
        
print(table[S]%mod)

### FIXED CODE ###

S = int(input())
mod = 10**9+7

table = [1]*(S+1)
table[0] = 0
table[1] = 0
if S >= 2:
    table[2] = 0

for s in range(6,S+1):
    for i in range(3,s-2):
        table[s] += table[i]
        table[s] %= mod
        
print(table[S]%mod)
h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
ans = [[0 for x in range(w)] for y in range(h)]

def getx(i):
    return i // h
def gety(i):
    return i % h if i // (2 * h) < h else h - (i % h)

aa=[]
for i in range(n):
    aa += [i + 1 for _ in range(a[i])]

for i in range(h * w):
    ans[gety(i)][getx(i)] = aa[i]

for y in range(h):
    for x in range(w):
        if x > 0: print(' ', end='')
        print(ans[y][x], end='')
    print()

### FIXED CODE ###

h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
ans = [[0 for x in range(w)] for y in range(h)]

def getx(i):
    return i // h
def gety(i):
    if (i % (2 * h)) < h:
        return i % h
    else:
        return h - i % h - 1

aa=[]
for i in range(n):
    aa += [i + 1 for _ in range(a[i])]

for i in range(h * w):
    ans[gety(i)][getx(i)] = aa[i]

for y in range(h):
    for x in range(w):
        if x > 0: print(' ', end='')
        print(ans[y][x], end='')
    print()
N = int(input())
A = list(map(int,input().split()))

R = []

for i in range(min(A), max(A)):
    cost = 0
    for j in range(len(A)):
        cost += (i - A[j])**2
    R.append(cost)

print(min(R))


### FIXED CODE ###

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

R = []

for i in range(min(A), max(A)):
    cost = 0
    for j in range(len(A)):
        cost += (i - A[j])**2
    R.append(cost)

if R == []:
    print(0)
else:
    print(min(R))
a = input()
s=input()
if a >= 3200:
  print(s)
else:
    print('red')

### FIXED CODE ###

a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')
S = input()
T = input()
if (S in T) and (S[0] == T[0])
  if ((len(S) > 1) and (S[1] == T[1])) or (len(S) == 1):
    print('Yes')
else:
  print('No')
  


### FIXED CODE ###

S = input()
T = input()
if (S in T) and (S[0] == T[0]):
  if ((len(S) > 1) and (S[1] == T[1])) or (len(S) == 1):
    print('Yes')
else:
  print('No')
n , m = map(int , input().split())
dp = []
for i in range(n + 1):
    dp.append([])
    for j in range(m + 1):
        dp[i].append(0)
arr = []
for i in range(n):
    arr.append(input())
dp[1][1] = 1
for i in range(1,n + 1):
    for j in range(1,m + 1):
        if arr[i - 1][j - 1] == '#' or (i == 1 and j == 1):
            continue
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n][m] % 1000000007

### FIXED CODE ###

n , m = map(int , input().split())
dp = []
for i in range(n + 1):
    dp.append([])
    for j in range(m + 1):
        dp[i].append(0)
arr = []
for i in range(n):
    arr.append(input())
dp[1][1] = 1
for i in range(1,n + 1):
    for j in range(1,m + 1):
        if arr[i - 1][j - 1] == '#' or (i == 1 and j == 1):
            continue
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n][m] % 1000000007)
from itertools import accumulate
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


surplus = [(a - b) for a, b in zip(A, B) if (a - b) > 0]
surplus.sort(reverse=True)
surplus = [0] + list(accumulate(surplus))

short = [(b - a) for a, b in zip(A, B) if (b - a) > 0]
need = sum(short)
short_num = len(short)


if need > sum(surplus):
    print(-1)
    exit()
else:
    for i in range(N + 1):
        if surplus[i] >= need:
            print(i + short_num)
            exit()


### FIXED CODE ###

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

A_origin = A[:]

if sum(A) < sum(B):
    print(-1)
    exit()

diff = [[i, a - b] for i, a, b in zip(range(N), A, B)]

order = sorted([[i, x] for i, x in diff if x > 0], key=lambda d: d[1])
C = []

charge = order.pop()
for i in range(N):
    while A[i] - B[i] < 0:
        if charge[1] > B[i] - A[i]:
            A[charge[0]] -= (B[i] - A[i])
            charge[1] -= (B[i] - A[i])
            A[i] = B[i]
        else:
            A[charge[0]] = B[charge[0]]
            A[i] += charge[1]
            charge = order.pop()

ans = 0
for a, ao in zip(A, A_origin):
    if a != ao:
        ans += 1

print(ans)
while 1:
  x = int(raw_innput())
  if x ~= 0:
    print 'Case i: {0}'.format(x)
  else:
    break

### FIXED CODE ###

count = 1
while 1:
  x = int(raw_input())
  if x == 0:
    break
  print 'Case {0}: {1}'.format(count, x)
  count += 1
N = int(input())
S = input()
print(S.count('ABC'))


### FIXED CODE ###

K, X = map(int, input().split())
k = K * 500
if k >= X:
  print('Yes')
else:
  print('No')
n,k = map(int, input().split())
binary = [0 for _ in range(n)]
ls = list(map(int, input().split()))
for i in ls:
    binary[i-1] += 1
binary = sorted(binary)
binary.pop(binary.index(0))

ans = 0
i = 0
while k < len(binary) - binary.count(0):
    if binary[i] != 0:
        ans += binary[i]
        binary.pop(i)
    i+=1
print(ans)

### FIXED CODE ###

from collections import Counter

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

c = Counter(A)
d = sorted(c.values())
l = len(d)
print(sum(d[0:l-K]))
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)

### 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)
n = input()
a = [int(i) for i in input.split()]
X = 0
ans = 0
for i in a:
    X += i
    if X > 0:
        b = -1 - X
        ans += b - a[i+1]
    else:
        b = 1 - X
        ans += b - a[i+1]
print (ans)

### FIXED CODE ###

n=input()
a=[int(i) for i in input().split()]
def chk(a,t):
    ans=0
    x=0
    for i in a:
        x+=i
        if t==True and x<1:
            ans+=1-x
            x=1
        elif t==False and x>-1:
            ans+=x+1
            x=-1
        t=not t
    return ans
print(min(chk(a,True),chk(a,False)))
from itertools import groupby
from numpy import cumsum


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

if len(set(S)) == 1:
    print(N)
    exit()

# ランレングス圧縮
G = []
for k, v in groupby(S):
    G.append(len(list(v)))
# 1 0 1 0 1...の配列が欲しいので、
# 先頭、末尾が0ならダミーの要素をそれぞれ追加する
if S[0] == '0':
    G.insert(0, 0)
if S[-1] == '0':
    G.append(0)

cum = [0]
cum.extend(list(cumsum(G)))
cum.append(0)

ans = 0
gc = len(G)
w = min(gc, 3+(K-1)*2)
for i in range(0, gc, 2):
    ans = max(ans, cum[i+w]-cum[i])
print(ans)


### FIXED CODE ###

from itertools import groupby
from numpy import cumsum


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

if len(set(S)) == 1:
    print(N)
    exit()

G = []
if S[0] == '0':
    G.append(0)
for k, v in groupby(S):
    G.append(len(list(v)))
G.append(0)

cum = [0]
cum.extend(list(cumsum(G)))
cum.append(0)

ans = 0
gc = len(G)
w = min(gc, 3+(K-1)*2)
for i in range(0, gc-w+2, 2):
    ans = max(ans, cum[i+w]-cum[i])
print(ans)
import sys
for c in sys.stdin:
    a,b=sorted(map(int,c.split()))
    if a=b==0:break
    print(a,b)

### FIXED CODE ###

import sys
for c in sys.stdin:
    a,b=sorted(map(int,c.split()))
    if a+b==0:break
    print(a,b)
n,k = map(int, input().split())
cnt=0
while n!=0:
    n=n//k
    cnt+=1
print(cnt)

### FIXED CODE ###

N, R = map(int, input().split())
if N > 10:
  print(R)
else :
  print(100 * (10 - N) + R)
def gcd(a, b):
    if b == 1:
        return 1
    # a > b　を仮定
    r = a // b
    mod = a % b
    if mod == 0:
        return b
    else:
        return gcd(b, r)

def lcm(A, n):
    if n == 2:
        return A[0]*A[1] // gcd(A[0], A[1])
    #lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
    a = lcm(A, n-1)
    return a*A[n-1] // gcd(a, A[n-1])

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a.sort(reverse = True)
ans = lcm(a, n)
print(str(ans))

### FIXED CODE ###

def gcd(a, b):
    if b == 1:
        return 1
    # a > b　を仮定
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r)

#def lcm(A, n):
#    if n == 2:
#        return A[0]*A[1] // gcd(A[0], A[1])
#    #lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
#    a = lcm(A, n-1)
#    return a* A[n-1] // gcd(a, A[n-1])

n = int(input())
#a = []
T1 = int(input())
for i in range(n-1):
    T2 = int(input())
    T1 = T1*T2 // gcd(T1, T2)
    #a.append(int(input()))
#a.sort(reverse = True)
#ans = lcm(a, n)
print(str(T1))
n,l=map(int, input().split())
ss=[input() for i in range(n)]
print(''.join(ss.sort()))

### FIXED CODE ###

n,l=map(int, input().split())
ss=[input() for i in range(n)]
ss.sort()
print(''.join(ss))
i = input().split(' ')

W = int(i[0])
H = int(i[1])
x = int(i[2])
y = int(i[3])
r = int(i[4])

if x - r >= 0 and y - r >= 0 and x + r <= W and y + r <= H:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
if a <= b <= c:
    print(a, b, c)
elif a <= c <= b:
    print(a, c, b)
elif b <= a <= c:
    print(b, a, c)
elif b <= c <= a:
    print(b, c, a)
elif c <= a <= b:
    print(c, a, b)
else:
    print(c, b, a)
n, m = map(int, input().split())

root = [-1]*n

def r(x):
    if root[x] < 0 :
        return x
    else:
        root[x] = r(root[x])
        return root[x]

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x

def size(x):
    x = r(x)
    return - root[x]

for i in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    unite(x,y)

max_size = max(map(size,range(n)))

print(max_size)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

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

root = [-1]*n

def r(x):
    if root[x] < 0 :
        return x
    else:
        root[x] = r(root[x])
        return root[x]

def unite(x, y):
    x = r(x)
    y = r(y)
    if x == y:
        return
    root[x] += root[y]
    root[y] = x

def size(x):
    x = r(x)
    return - root[x]

for i in range(m):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    unite(x,y)

max_size = max(map(size,range(n)))

print(max_size)
while 1:
    a, b, c = raw_input().split()
    if b == "?":
        break
    a = int(a)
    c = int(c)
    if b == "+":
        print a+b
    elif b == "*":
        print a*b
    elif b == "/"
        print a//b


### FIXED CODE ###

while True:
    a, b, c = input().split()
    a = int(a)
    c = int(c)
    ans = 0
    if b == "?":
        break
    elif b == "+":
        ans = a+c
    elif b == "-":
        ans = a-c
    elif b == "*":
        ans = a*c
    elif b == "/":
        ans = a//c
    print(ans)
mod=10**9+7
s=int(input())
dp=[1]*(s+1)
dp[0]=0
dp[2]=0
dp[1]=0
for i in range(3,s+1):
    for j in range(3,i-2):
        dp[i]+=dp[j]
print(dp[s]%mod)



### FIXED CODE ###

mod=10**9+7
s=int(input())
dp=[1]*(s+1)
if s==1 or s==2:
    print(0)
    quit()
for i in range(3,s+1):
    for j in range(3,i-2):
        dp[i]+=dp[j]
print(dp[s]%mod)
n, m = map(int, input().split())

lis = []
for i in range(m):
    lis.append(list(map(int, input().split())))
    
ans = [0,0,0]
if n == 2:
    ans[1] = 1
elif n == 3:
    ans[0] = 1
    
k = 0
out = []

for i in lis:
    if i[0] not in out:
        ans[int(i[0]-1)] = int(i[1])
        out.append(i[0])
    elif i[0] in out and i[1] != ans[i[0]-1]:
        k += 1

inte = ans[0] * 100 + ans[1]*10 + ans[2]
    
    
if inte > 0 and k ==0:
    print(inte)
else:
    print(-1)


### FIXED CODE ###

n = int(input())

p = n//2 + n%2
print(p)
l = ['dream', 'dreamer', 'erase', 'eraser']
S = input()

while len(S) > 0:
	flag = False
	for d in l:
		if S.endswith(d):
			S = S[:-len(d)]
			flag = True
			break
	if flag = False:
		print('NO')
		exit()
		
print('YES')

### FIXED CODE ###

import re

S = input()
x = r"^(dream|dreamer|erase|eraser)*$"

if re.match(x,S):
	print('YES')
else:
	print('NO')
def calc():
    summ  = sum(A)
    low = summ * 1 / 4*M
    high = 1000

    newlist = [i for i in A if low <= i < high]

    lot = len(newlist)

    if M < lot:
        print ("No")
    else:
        print ("Yes")

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

calc()


### FIXED CODE ###

#def calc():
    #summ  = sum(A)
    #print(summ)
    
    #low = summ / (4*M)
    #print(low)

    #newlist = [i for i in A if i >= low]
    #print(newlist)

    #num = len(newlist)
    #print(num)

    #if M <= num:
        #print ("Yes")
    #else:
        #print ("No")

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

#N, M = 5, 2
#A = [110, 2, 20, 10, 0]
#calc()

S = sum(A)
cnt = 0

for i in A:
    if i >= S / (4*M):
        cnt += 1
if cnt >= M:
    print("Yes")
else:
    print("No")
a,b,c = list(map(int,input().split()))
if any([i%2==0 for i in (a,b,c)]):
    print(0)
else:
    ans = min(a*b*(c//2+1) - a*b*(c//2) , c*b*(a//2+1) - c*b*(a//2) , a*c*(b//2+1) - a*c*(b//2))
print(ans)

### FIXED CODE ###

a,b,c = map(int,input().split())

p = any((a%2 == 0,b%2 == 0,c%2 == 0))
if p:
    print(0)
else:
    print(min(a*b,b*c,c*a))
n = int(input())
buf = []
for i in range(5):
  buf.apend(int(input()))
  
print(n // min(buf) + 6 - (n % min(buf) == 0))
  

### FIXED CODE ###

n = int(input())
buf = []
for i in range(5):
  buf.append(int(input()))
  
print(n // min(buf) + 5 - (n % min(buf) == 0))
def main():
    x_max, y_max, n = map(int, input().split())
    x_min, y_min = 0, 0

    for n in range(n)def main():
    x_max, y_max, n = map(int, input().split())
    x_min, y_min = 0, 0

    for n in range(n):
        x, y, a = map(int, input().split())

        if a == 1:
            x_min = max(x_min, x)
        elif a == 2:
            x_max = min(x_max, x)
        elif a == 3:
            y_min = max(y_min, y)
        elif a == 4:
            y_max = min(y_max, y)

    print(max(0, x_max - x_min) * max(0, y_max - y_min))

        # if (a == 1) and (x > x_min):
        #     x_min = x
        # elif (a == 2) and (x < x_max):
        #     x_max = x
        # elif (a == 3) and (y > y_min):
        #     y_min = y
        # elif (a == 4) and (y < y_max):
        #     y_max = y
        # 
        # if (x_max <= x_min) or (y_max <= y_min):
        #     print(0)
        #     return

    # print((x_max - x_min) * (y_max - y_min))

if __name__ == "__main__":

    main()
:
        x, y, a = map(int, input().split())

        if a == 1:
            x_min = max(x_min, x)
        elif a == 2:
            x_max = min(x_max, x)
        elif a == 3:
            y_min = max(y_max, y)
        elif a == 4:
            y_max = min(y_max, y)

    print(max(0, x_max - x_min) * max(0, y_max - y_min))

        # if (a == 1) and (x > x_min):
        #     x_min = x
        # elif (a == 2) and (x < x_max):
        #     x_max = x
        # elif (a == 3) and (y > y_min):
        #     y_min = y
        # elif (a == 4) and (y < y_max):
        #     y_max = y
        # 
        # if (x_max <= x_min) or (y_max <= y_min):
        #     print(0)
        #     return

    # print((x_max - x_min) * (y_max - y_min))

if __name__ == "__main__":

    main()


### FIXED CODE ###

def main():
    x_max, y_max, n = map(int, input().split())
    x_min, y_min = 0, 0

    for n in range(n):
        x, y, a = map(int, input().split())

        if (a == 1) and (x > x_min):
            x_min = x
        elif (a == 2) and (x < x_max):
            x_max = x
        elif (a == 3) and (y > y_min):
            y_min = y
        elif (a == 4) and (y < y_max):
            y_max = y

        if (x_max <= x_min) or (y_max <= y_min):
            print(0)
            return

    print((x_max - x_min) * (y_max - y_min))

if __name__ == "__main__":

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

for i in range(1,n+1):
  ans=k
  for j in range(q):
    que=int(input())
    if que!=i:
      ans-=1
  if ans<=0:
    print("No")
  else:
    print("Yes")
  

### FIXED CODE ###

from collections import Counter

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

l_c=Counter(l)

for i in range(1,n+1):
  ok=l_c[i]
  num=k-q+ok
  if num>0:
    print("Yes")
  else:
    print("No")
import math
def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))
 
# 整数の入力
N = int(input())
r = 2

print(combinations_count(N, r))

### FIXED CODE ###

# 整数の入力
a = int(input())

if a == 0:
  print(1)
else:
  print(0)
w,h,x,y = map(int,input().split())
first = min(x*h,(w-x)*h)
second =min(y*w,(h-y)*w)
if first == second:
        print(f"{first:6f} 1")
else:
        print(f"{max(first,second):6f} 0")


### FIXED CODE ###

h,w,x,y = map(int,input().split())
ans1 = (h*w)/2
if h == 2*x and w == 2*y:
    ans2 = 1
else:
    ans2 = 0
print(ans1,ans2)
S,W = map(int, input.split())

        if S > W :
            print("safe")
        else :
            print("unsafe")





### FIXED CODE ###

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

if S > W :
    print("safe")
else :
    print("unsafe")
def solve(k):
    print(2)
    print(f"0 {k}")
solve(k=int(input()))

### FIXED CODE ###

def f(k):
    n = 50
    a = [k//n + n-1] * n
    for i in range(k%n):
        for j in range(n):
            if i == j:
                a[j] += n
            else:
                a[j] -= 1
    return a

def solve(k):
    a = f(k)
    print(len(a))
    print(" ".join(map(str, a)))

solve(k=int(input()))
N = int(input())
def func(n):
  ret = 0
  for i in range(p):
    for j in range(p):
      for k in range(p):
        if (i+j)**2+(j+k)**2+(k+i)**2 == 2*p:
          ans += 1
for i in range(N):
  print(func(i))

### FIXED CODE ###

N = int(input())
ans = [0]*10050
for i in range(1,105):
  for j in range(1,105):
    for k in range(1,105):
      v = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if v < 10050:
        ans[v] += 1
for i in range(N):
  print(ans[i+1])
A,B,X = map(int,input().split())

i=0
N = 0
if A*(10**9) + B*(10) <= X:
    N=10**9
else:
    while i < 10:
        if A*(10**i) + B*(i+1) > X:
            if i==0:
                N = 0
            else:
                N = (X-B*i)//A
                if N < 10**(i-1):
                    N = 0
            break
        else:
            i += 1

print(N)

### FIXED CODE ###

S = input()
WS = list(['SUN','MON','TUE','WED','THU','FRI','SAT'])

ans = 7 - WS.index(S)
print(ans)