Harryxun/stf_run huggingface dataset:
__author__ = 'CIPHER'
_project_ = 'PythonLehr'

class BoundingBox:
    def __init__(self, width, height):
        self.width = width;
        self.height = height;

    def CalculateBox(self, x, y, r):
        if x>= r and x<=(self.width-r) and y>=r and y<=(self.height-r):
            print("Yes")
        else:
            print("No")

width = int(input())
height = int(input())
x = int(input())
y = int(input())
r = int(input())

Box = BoundingBox(width, height)
Box.CalculateBox(x, y, r)

### FIXED CODE ###

__author__ = 'CIPHER'
_project_ = 'PythonLehr'

class BoundingBox:
    def __init__(self, width, height):
        self.width = width;
        self.height = height;

    def CalculateBox(self, x, y, r):
        if x>= r and x<=(self.width-r) and y>=r and y<=(self.height-r):
            print("Yes")
        else:
            print("No")
'''
width = int(input("Width of the Box: "))
height = int(input("Height of the Box: "))
x = int(input("location of x: "))
y = int(input("location of y: "))
r = int(input("radius of the circle; "))
'''

# alternative input
inputList = input()
inputList = inputList.split(' ')
inputList = [int(x) for x in inputList]
# print(inputList)
width = inputList[0]
height = inputList[1]
x = inputList[2]
y = inputList[3]
r = inputList[4]

Box = BoundingBox(width, height)
Box.CalculateBox(x, y, r)
A,B=map(int,input())
if A*B%2==0 :
  print("No")
else :
  print("Yes")

### FIXED CODE ###

A,B=map(int,input().split())
if A*B%2==0 :
  print("No")
else :
  print("Yes")
N = input()
seat = 100000
for _ in range(N):
    l,r = map(int,input().split())
     seat -= r - l + 1
print(seat)

### FIXED CODE ###

N = int(input())
seat = 0
for _ in range(N):
    l,r = map(int,input().split())
    seat += r - l + 1
print(seat)
n,m,k=map(int,input().split())
w=[i for i in range(n+1)]
s=[1]*(n+1)
g=[list(map(int,input().split()))for i in range(n)]
def root(x):
    if w[x]==x:
        return x
    x=w[x]
    return root(w[x])
def unite(x,y):
    x=root(x)
    y=root(y)
    if x!=y:
        if s[x]<s[y]:
            w[x]=y
            s[y]+=1
        else:
            w[y]=x
            s[x]+=1
for i in range(m):
    a,b=g[i][0],g[i][1]
    unite(a,b)
for i in range(1,n+1):
    w[i]=root(i)
    s[i]=s[w[i]]
for i in range(m):
    s[g[i][0]]-=1
    s[g[i][1]]-=1
for i in range(k):
    a,b=map(int,input().split())
    if w[a]==w[b]:
        s[a]-=1
        s[b]-=1
for i in range(1,n+1):s[i]-=1
print(*s[1:])

### FIXED CODE ###

n=int(input())
print((n+1)//2)
import math
N,A,B = map(int,input().split())
H = [int(input()) for i in range(N)]
Hs = sum(H)
c = A - B
M = math.ceil(Hs / (B * N))

m = math.ceil(Hs / (A * N))

nibun = [M,m]
while M - m > 1:
	n = (M + m) // 2
	H2 = [H[i] - n * B for i in range(N) if H[i] - n * B > 0]
	cnts = [math.ceil(H2[i] / c) for i in range(len(H2))]
	cnt = sum(cnts)
	if cnt > n:
		m = n
	else:
		M = n
print(m)

### FIXED CODE ###

n = int(input())
S = [int(input()) for i in range(n)]
S.sort()
if sum(S) % 10 == 0:
	flag = 0
	for s in S:
		if s % 10 != 0:
			flag = 1
			break
	if flag == 1:
		print(sum(S) - s)
	else:
		print(0)
else:
	print(sum(S))
# def merge(A, left, mid, right):
#     L = A[left:mid] + [1000000]
#     R = A[mid:right] + [1000000]
#     # L.append(1000000)
#     # R.append(1000000)

#     i = 0
#     j = 0
#     global count
    
#     for k in range(left, right):
#         count += 1
#         if L[i] <= R[j]:
#             A[k] = L[i]
#             i += 1
#         else:
#             A[k] = R[j]
#             j += 1

def merge(A, left, mid, right):
    global count
    inf = 10 ** 9
    L = A[left:mid] + [inf]
    R = A[mid:right] + [inf]
 
    i = 0
    j = 0
    for k in range(left, right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R

def merge_sort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)

n = int(input())
A = list(map(int, input().split()))
count = 0
merge_sort(A, 0, len(A))

print(' '.join(list(map(str, A))))
print(count)


### FIXED CODE ###

def merge(A, left, mid, right):
    global count
    inf = 10 ** 9
    L = A[left:mid] + [inf]
    R = A[mid:right] + [inf]

    i = 0
    j = 0
    for k in range(left, right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1

def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

n = int(input())
A = list(map(int, input().split()))
count = 0
mergeSort(A, 0, n)

print(' '.join(list(map(str, A))))
print(count)
a = input()
b = input()
c = input()

print(int(a)*int(b)/2)


### FIXED CODE ###

AB,BC,CA = map(int,input().split())
print(int(AB*BC/2))
def root(V):
    for v in V:
        if v.isroot:
            return v
    return None

def add(r):
    if r.next==[]:
        pass
    else:
        for v in r.next:
            v.val+=r.val
            add(v)

class Vertex:
    def __init__(self):
        self.val=0
        self.next=[]
        self.isroot=True

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

V=[Vertex() for i in range(N)]

for i in range(N-1):
    a,b=map(int,input().split())
    V[a-1].next.append(V[b-1])
    V[b-1].isroot=False

for i in range(Q):
    p,x=map(int,input().split())
    V[p-1].val+=x

r=root(V)
add(r)

for v in V:
    print(v.val,end=' ')

### FIXED CODE ###

from collections import deque

N,Q=map(int,input().split())
out=[set() for i in range(N+1)];out[0]=None # 頂点は1-initial
for j in range(N-1):
    a,b=map(int,input().split())
    out[a].add(b)
    out[b].add(a)
# print(out) #DB

a=[0 for i in range(N+1)];a[0]=None

for k in range(Q):
    p,x=map(int,input().split())
    a[p]+=x

# print(a) #DB

q=deque()
q.append(1)
while q:
    u=q.popleft()
    for v in out[u]:
        a[v]+=a[u]
        q.append(v)
        out[v].remove(u)
        # print(q) #DB
    out[u].clear()

print(*a[1:])
import numpy as np
h,w=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(h)]
b=[list(map(int,input().split())) for _ in range(h)]
d=[]
for i in range(h):
  d.append([abs(a[i][j]-b[i][j]) for j in range(w)])
dp=np.full((h,w,200),False)
# dp[r][c][j]:(r,c)まで考えたときjにできるかbool値
dp[0,0,d[0][0]+100]=True
for i in range(w-1):
  if d[0][i+1]==0:
    dp[0,i+1]+=dp[0,i]
    continue
  dp[0,i+1,d[0][i+1]:]+=dp[0,i,:-d[0][i+1]]
  dp[0,i+1,:-d[0][i+1]]+=dp[0,i,d[0][i+1]:]
for i in range(h-1):
  if d[i+1][0]==0:
    dp[i+1,0]+=dp[i,0]
    continue
  dp[i+1,0,d[i+1][0]:]+=dp[i,0,:-d[i+1][0]]
  dp[i+1,0,:-d[i+1][0]]+=dp[i,0,d[i+1][0]:]
for r in range(1,h):
  for c in range(1,w):
    if d[r][c]==0:
      dp[r,c]+=dp[r-1,c]
      dp[r,c]+=dp[r,c-1]
      continue
    dp[r,c,d[r][c]:]+=dp[r-1,c,:-d[r][c]]
    dp[r,c,:-d[r][c]]+=dp[r-1,c,d[r][c]:]
    dp[r,c,d[r][c]:]+=dp[r,c-1,:-d[r][c]]
    dp[r,c,:-d[r][c]]+=dp[r,c-1,d[r][c]:]
print(min([abs(e-100) for e in np.where(dp[h-1,w-1]==True)[0]]))


### FIXED CODE ###

import numpy as np
h,w=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(h)]
b=[list(map(int,input().split())) for _ in range(h)]
d=[]
for i in range(h):
  d.append([abs(a[i][j]-b[i][j]) for j in range(w)])
dp=np.zeros((h,w,12800))
# dp[r][c][j]:(r,c)まで考えたときjにできるか。0：できない。1以上：できる。
dp[0,0,d[0][0]+6400]=1
for i in range(w-1):
  if d[0][i+1]==0:
    dp[0,i+1]+=dp[0,i]
    continue
  dp[0,i+1,d[0][i+1]:]+=dp[0,i,:-d[0][i+1]]
  dp[0,i+1,:-d[0][i+1]]+=dp[0,i,d[0][i+1]:]
for i in range(h-1):
  if d[i+1][0]==0:
    dp[i+1,0]+=dp[i,0]
    continue
  dp[i+1,0,d[i+1][0]:]+=dp[i,0,:-d[i+1][0]]
  dp[i+1,0,:-d[i+1][0]]+=dp[i,0,d[i+1][0]:]
for r in range(1,h):
  for c in range(1,w):
    if d[r][c]==0:
      dp[r,c]+=dp[r-1,c]
      dp[r,c]+=dp[r,c-1]
      continue
    dp[r,c,d[r][c]:]+=dp[r-1,c,:-d[r][c]]
    dp[r,c,:-d[r][c]]+=dp[r-1,c,d[r][c]:]
    dp[r,c,d[r][c]:]+=dp[r,c-1,:-d[r][c]]
    dp[r,c,:-d[r][c]]+=dp[r,c-1,d[r][c]:]
print(min([abs(e-6400) for e in np.where(dp[h-1,w-1]>0)[0]]))
##### 解けた #####

a,b=list(map(int,input()))

print((a+b)//2)

### FIXED CODE ###

##### 解けた #####
from math import ceil

a,b=list(map(int,input().split(" ")))

print(ceil((a+b)/2))
s = input().split()
k = 0
for i in range(3):
  if s[i] == '1':
    k = k + 1
print(k)

### FIXED CODE ###

s = (input())
p = [int(c) for c in s]
k = 0
for i in range(3):
  if p[i] == 1:
    k = k + 1
print(k)
import numpy as np
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = np.array([10**10]*(n))
dp[0] = 0
if n-1 <= k:
    print(abs(h[-1]-h[0]))
else:
    for i in range(1,k+1):
        dp[i] = abs(h[i]-h[0])
    for i in range(k+1,n): 
        for j in range(1,k+1):
            dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
    print(dp[-1])

### FIXED CODE ###

import numpy as np
n,k = map(int, input().split())
h = np.array(list(map(int, input().split())))

dp = np.zeros(n, dtype = int)
for i in range(1,n):
    s = max(0,i-k)
    dp[i] = min(dp[s:i] + np.abs(h[i] -h[s:i]))
print(dp[-1])
a,b,c = map(int,input().split())

if (a < b and b < c) or (a > b and b > c):
    print("No")
else:
    print("Yes")


### FIXED CODE ###

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

a = S[K-1]

ans = ""
for i in range(N):
    if S[i] == a:
        ans += a
    else:
        ans += "*"
print(ans)
N, K = map(int, input().split())
	h = list(map(int, input().split()))
 
	dp=[0]*N
 
	for i in range(1,N):
		dp[i] = min(
			dp[g] + abs(h[i] - h[g]) for g in range(max(i-K,0), i)
		)
	print(dp[N-1])

### FIXED CODE ###

def main():
	N, K = map(int, input().split())
	h = list(map(int, input().split()))
 
	dp=[0]*N
 
	for i in range(1,N):
		dp[i] = min(
			dp[g] + abs(h[i] - h[g]) for g in range(max(i-K,0), i)
		)
	print(dp[N-1])
main()
from sys import exit
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

n,k=map(int,input().split())
s=list(input())
x=groupby(s)
l=len(x)
y=[x[i][1] for i in range(l)]

if

if x[0][0]=="0":
    su=sum(y[:2*k])
    ans=su
    y.pop(0)
    l-=1
else:
    ans=0
su=sum(y[:2*k+1])
ans=max(ans,su)
l_sub=(l-(2*k+1))//2
if l_sub<=0:
    print(ans)
    exit()
for i in range(l_sub):
    su-=y[2*i]
    su-=y[2*i+1]
    su+=y[2*k+1+(2*i)]
    su+=y[2*k+1+(2*i+1)]
    ans=max(su,ans)
if 2*k+1+2*l_sub<l:
    su-=y[2*l_sub]
    su+=y[2*k+1+2*l_sub]
    ans=max(su,ans)
print(ans)


### FIXED CODE ###

from sys import exit
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

n,k=map(int,input().split())
s=list(input())
x=groupby(s)
l=len(x)
y=[x[i][1] for i in range(l)]

if x[0][0]=="0":
    su=sum(y[:2*k])
    ans=su
    y.pop(0)
    l-=1
else:
    ans=0
su=sum(y[:2*k+1])
ans=max(ans,su)
l_sub=(l-(2*k+1))//2
if l_sub<=0:
    print(ans)
    exit()
for i in range(l_sub):
    su-=y[2*i]
    su-=y[2*i+1]
    su+=y[2*k+1+(2*i)]
    su+=y[2*k+1+(2*i+1)]
    ans=max(su,ans)
#最後のところの判定っぽいな
if 2*k+1+2*l_sub<l:
    su-=y[2*l_sub]
    su-=y[2*l_sub+1]
    su+=y[2*k+1+2*l_sub]
    ans=max(su,ans)
print(ans)
from math import factorial

N, K = map(int, input().split())
mod = 10 ** 9 + 7

for i in range(1, K+1):
    ans = factorial(N - K + 1)
    ans *= factorial(K - 1)
    ans //= factorial(N - K + 1 - i)
    ans //= factorial(i)
    ans //= factorial(K - i)
    ans //= factorial(i - 1)
    print(ans % mod)


### FIXED CODE ###

from operator import mul
from functools import reduce

MOD = 10 ** 9 + 7

def cmb(n, r):
    if n < r:
        return 0
    r = min(n - r, r)
    if r == 0:
        return 1
    numer = reduce(mul, range(n, n - r, -1))
    denom = reduce(mul, range(1, r + 1))
    return numer // denom % MOD
N, K = map(int, input().split())

for i in range(1, K + 1):
    print(cmb(K - 1, i - 1) * cmb(N - K + 1, i) % MOD)
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    else
        while x /= 10 > 0:
        if x % 10 == 3:
            ret += " " + str(i)
    i+=1
    if i > n:
        break

print(ret)



### FIXED CODE ###

#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()
all_set = ['S ' + str(i) for i in range(1, 14)]　+ ['H ' + str(i) for i in range(1, 14)] + ['C ' + str(i) for i in range(1, 14)] + ['D ' + str(i) for i in range(1, 14)]
r = int(input())

for _ in range(r):
    x = input()
    if x in all_set:
        del all_set[all_set.index(x)]
        
for i in all_set:
    print(i)


### FIXED CODE ###

all_set = ['S ' + str(i) for i in range(1, 14)] + ['H ' + str(i) for i in range(1, 14)] + ['C ' + str(i) for i in range(1, 14)] + ['D ' + str(i) for i in range(1, 14)]
r = int(input())

for _ in range(r):
    x = input()
    if x in all_set:
        del all_set[all_set.index(x)]
        
for i in all_set:
    print(i)
a,b = map(int, input().split())

ans = 0
A  = 1
while A < b:
  ans += 1
  s += a - 1
print(ans)


### FIXED CODE ###

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

ans = 0
A = 1
while A < b:
  ans += 1
  A += (a - 1)
print(ans)
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
  exit
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
    else:
      b1=0
    print(a1,b1)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
  else:
    b1=0
  print(a1,b1)
a,b=map(int, input().split())
c = (b-1) / (a-1)

if( (b-1) % (a-1) > 0:
   c = c+1
print(c)


### FIXED CODE ###

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

if (b-1) % (a-1) > 0 :
   c = c+1
print(c)
N = int(input())
li = list(map(int,input().split()))

for i in range(N-1):
  if li[i+1] >= li[i]+2:
    print("No")
    sys.exit()
    
  elif li[i+1] == li[i]+1:
    li[i+1] = li[i]
    
  else: continue
    
print("Yes")

### FIXED CODE ###

import sys

N = int(input())
li = list(map(int,input().split()))
li.reverse()

for i in range(N-1):
  if li[i+1] >= li[i]+2:
    print("No")
    sys.exit()
    
  elif li[i+1] == li[i]+1:
    li[i+1] = li[i]
    
  else: continue
    
print("Yes")
h, w = map(int, input().split())
mat_a = [ list(input()) for _ in range(h) ]


ans = 'Possible'
ans = 'Impossible'

def check(i,j):
    if mat_a[i][j] == '.':
        return True

    count = 0
    try:
        if mat_a[i][j-1] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i-1][j] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i][j+1] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i+1][j] == '#':
            count += 1
    except:
        pass

    if count == 2 or count ==4:
        return True
    else:
        return False    


ans = True
for i in range(h):
    for j in range(w):
        if not check(i,j):
            if i+1 == h and j+1 == w:
                continue
            if i == 0 and j == 0:
                continue
            ans = False
            break

if ans:
    print('Possible')
else:
    print('Impossible')
(env3) (kentaro:~/git/2020/atcode/20200717/3 2020-07-17T17:09:31)$ vi main.py 
(env3) (kentaro:~/git/2020/atcode/20200717/3 2020-07-17T17:10:52)$ cat main.py 
h, w = map(int, input().split())
mat_a = [ list(input()) for _ in range(h) ]

def check(i,j):
    if mat_a[i][j] == '.':
        return True

    count = 0
    try:
        if mat_a[i][j-1] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i-1][j] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i][j+1] == '#':
            count += 1
    except:
        pass

    try:
        if mat_a[i+1][j] == '#':
            count += 1
    except:
        pass

    if count == 2 or count == 4:
        return True
    else:
        return False    


ans = True
for i in range(h):
    for j in range(w):
        if not check(i,j):
            if i+1 == h and j+1 == w:
                continue
            if i == 0 and j == 0:
                continue
            ans = False
            break

if ans:
    print('Possible')
else:
    print('Impossible')

### FIXED CODE ###

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

count = 0

ans = True
for i in range(h):
    for j in range(w):
        if mat_a[i][j] == '#':
            count+= 1

if count == h+w-1:
    print('Possible')
else:
    print('Impossible')
import sys, re
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from collections import deque, defaultdict, Counter
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop, heapify
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M, R = MAP()
r = LIST()
dist_matrix = [[INF]*N for _ in range(M)]

for _ in range(M):
	A, B, C = MAP()
	dist_matrix[A-1][B-1] = C
	dist_matrix[B-1][A-1] = C

for i in range(N):
	dist_matrix[i][i] = 0

#for i in range(N):
#	print(dist_matrix[i])
#print()

def Warshall_Floyd(dist, N):
	for k in range(N):
		for i in range(N):
			for j in range(N):
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

Warshall_Floyd(dist_matrix, N)

#for i in range(N):
#	print(dist_matrix[i])


ans = INF
for x in permutations(r):
	tmp = x[0]
	dis = 0
	for i in range(1, R):
		dis += dist_matrix[tmp-1][x[i]-1]
		tmp = x[i]
	ans = min(ans, dis)
	
print(int(ans))





### FIXED CODE ###

import sys, re
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from collections import deque, defaultdict, Counter
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop, heapify
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M, R = MAP()
r = LIST()
dist_matrix = [[INF]*N for _ in range(N)]

for _ in range(M):
	A, B, C = MAP()
	dist_matrix[A-1][B-1] = C
	dist_matrix[B-1][A-1] = C

for i in range(N):
	dist_matrix[i][i] = 0

#for i in range(N):
#	print(dist_matrix[i])
#print()

def Warshall_Floyd(dist, N):
	for k in range(N):
		for i in range(N):
			for j in range(N):
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j])

Warshall_Floyd(dist_matrix, N)

#for i in range(N):
#	print(dist_matrix[i])


ans = INF
for x in permutations(r):
	tmp = x[0]
	dis = 0
	for i in range(1, R):
		dis += dist_matrix[tmp-1][x[i]-1]
		tmp = x[i]
	ans = min(ans, dis)
	
print(int(ans))
mport itertools
n,k = map(int,input().split())
l = list(range(n+1))
ad = 0
for i in list(range(k,n+2)):
        l2 = list(itertools.combinations(l,r=i))
        se = set(map(sum,l2))
        ad += len(se)
print(ad)

### FIXED CODE ###

N,K = map(int,input().split())
ad = 0
mod = 10 **9 + 7
for k in range(K,N+2):
  ma = (N*(N+1) - (N-k)*(N-k+1))//2
  mi = (k-1)*k//2
  ad += (ma - mi+1)
print(ad%mod)
s=list(input())
if len(s)==26:
    print("None")
    exit()
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s=set(s)
s=list(s)
s.sort()
for i in range(26):
    if a[i]!=s[i]:
        print(a[i])
        break
else:
    print("None")

### FIXED CODE ###

s=input()
a=list("abcdefghijklmnopqrstuvwxyz")
for x in a:
    if x not in s:
        print(x)
        exit()
print("None")
a=list(map(int,input().split()))
b=sorted(a, reverse=True)
print(b[0])
print(b[1])
print(b[2])

### FIXED CODE ###

#a=list(map(int,input().split()))
a=[]
for i in range(10):
    tmp = int(input())
    a.append(tmp)
b=sorted(a, reverse=True)
print(b[0])
print(b[1])
print(b[2])
A,B = map(int, input().split())
count = 0
for i in range(A, B+1):
  s = str(i)
  if s[0] == s[-1] and s[1] == i[-2]:
    count += 1
print(count)

### FIXED CODE ###

a = input()
b = input()
c = input()

print(a[0]+b[1]+c[2])
N = int(input())
li = list(map(int,input().split()))

lis = sorted(li)
for i in range(N):
  if lis[-1] == li[i]:
    print(lis[-2])
  else: print(lis[-1])
    


### FIXED CODE ###

N = int(input())
li = [int(input()) for _ in range(N)]

lis = sorted(li)
for i in range(N):
  if lis[-1] == li[i]:
    print(lis[-2])
  else: print(lis[-1])
n=int(input())
a= list(map(int, input().split())) 
p=[0]*n

for i in range(n):
  p[a[i]]=i+1
  print(p[i],end=" ")


### FIXED CODE ###

a=int(input())
b=[0]*a
c=list(map(int,input().split()))

for i in range(a):
  b[c[i]-1]+=i+1
print(' '.join(map(str, b)))
n,m = map(int,input().split())
k = [0]*n
a = [0]*m
b = [0]*m

for i in range(n) :
    a = list(map(int,input().split()))
    for j in range(1,len(a)) :
        b[a[j]] += 1

print(a.count(n))

### FIXED CODE ###

n,m = map(int,input().split())
k = [0]*n
a = [0]*(m+1)
b = [0]*(m+1)

for i in range(n) :
    a = list(map(int,input().split()))
    for j in range(1,len(a)) :
        b[a[j]] += 1

print(b.count(n))
n,*a=map(int,open(0).read().split())
b=a.pop(0)
if b!=0:print(0);exit()
import collections
d=collections.Counter(a)
e=[[i,j] for i,j in d.items()]
e.sort()
ans=1
d1=[i[0] for i in e]
d2=[i[1] for i in e]
for i,I,j,J in zip(d1,d1[1:],d2,d2[1:]):
    if i+1!=I:
        print(0)
        RE
    ans*=j**J
print(ans) 

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
mod=998244353
d={}
for i in a:
  d[i]=d.get(i,0)+1
b=list(d.items())
b.sort()
ans=1
if a[0]!=0 or len(b)!=b[-1][0]+1 or b[0][1]!=1:
    ans=0
for i in range(1,len(b)):
    ans*=b[i-1][1]**b[i][1]
    ans%=mod
print(ans)
a,b,c,d,e,f=map(int,input().split())
a*=100
b*=100
x=set()
for i in range(0,f+1,a):
    for j in range(0,f+1,b):
        if 0<(i+j)<=f:
            x.add(i+j)
y=set()
for i in range(0,f+1,c):
    for j in range(0,f+1,d):
        if 0<(i+j)<=f:
            y.add(i+j)

ans=[]
for n in x:
    for m in y:
        if n+m>f:
            continue
        if n*e<m*100:
            continue
        ans.append([n+m,m,m/n])

ans.sort(key=lambda x:x[2], reverse=True)

print(ans[0][0],ans[0][1])


### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
a*=100
b*=100
x=set()
for i in range(0,f+1,a):
    for j in range(0,f+1,b):
        if 0<(i+j)<=f:
            x.add(i+j)
y=set()
for i in range(0,f+1,c):
    for j in range(0,f+1,d):
        if 0<(i+j)<=f:
            y.add(i+j)

ans=[]
for n in x:
    for m in y:
        if n+m>f:
            continue
        if n*e<m*100:
            continue
        ans.append([n+m,m,m/n])
if not ans:
    print(a,0)
    exit()
ans.sort(key=lambda x:x[2], reverse=True)

print(ans[0][0],ans[0][1])
N, M = map(int, input().split())
A = []
A = input().split()
A = [int(n) for n in A]
for i in range(M):
  N -= A[i]
print(N)
N, M = map(int, input().split())
A = []
A = input().split()
A = [int(n) for n in A]
for i in range(M):
  N -= A[i]
if N >= 0:
  print(N)
else:
  print("-1")


### FIXED CODE ###

N, M = map(int, input().split())
A = []
A = input().split()
A = [int(n) for n in A]
for i in range(M):
  N -= A[i]
if N >= 0:
  print(N)
else:
  print("-1")