peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N,K = map(int,input().split())
MOD = 10**9 + 7

def sum_lr(l,r):
    return (l + r)*(r-l+1)//2


ans = 0
for i in range(K,N+2):
    a = sum_lr(N-(i-1),N)
    b = sum_lr(0,i-1)
    temp = a - b + 1
    # print('i',i)
    # print(a)
    # print(b)
    # print(temp)
    ans += temp
    ans %= MOD
print(ans)
# Judge status: Wrong Answer
s=input()
n=len(s)
s_int=[0]*n
x=pow(10,n-1)
for i in range(n):
    s_int[i]=int(s[i])
    x=x//10
# Judge status: Wrong Answer
N = int(input())
plan = [list(map(int, input().split())) for i in range(N)]
m = 0
for i in range(N-1):
    time = plan[i+1][0]-plan[i][0]
    dist = abs(plan[i+1][1]-plan[i][1])+abs(plan[i+1][2]-plan[i][2])
    if time == 0:
      m = 1
      break
    if dist>time:
      m = 1
      break
    if dist%2 != time%2:
      m = 1
      break
print('Yes' if m==0 else 'No')
# Judge status: Wrong Answer
n = int(input())
lis = list(map(int, input().split()))
b = 0
for i in range(n):
    a = 0
    for j in range(n-1):
        if lis[i] < lis[j]:
            a += 1
        if a == i -1:
            b += 1
print(b)
# Judge status: Wrong Answer
from fractions import gcd
n = int(input())

def lcm_base(x,y):
  return x*y/gcd(x,y)

ans =1
for i in range(n):
  i = int(input())
  ans = lcm_base(ans,i)
print(int(ans))
# Judge status: Wrong Answer
S = input()
T = input()

lenS = len(S)
lenT = len(T)
substrings = [(i, j, T[i: j]) for i in range(lenT) for j in range(i + 1, lenT + 1)]

minv = lenT
for i, j, s in substrings:
    if s in S:
        sidx = S.index(s)
        if (sidx >= i) & (sidx + j - i <= lenS):
            candidate = lenT - (j - i)
            if minv > candidate:
                minv = candidate
print(minv)
# Judge status: Wrong Answer
import math
n,h = map(int,input().split())
A = 0; b = []; ans = 0
for _ in range(n):
    u,v = map(int,input().split())
    A = max(A,u); b.append(v)

for B in sorted(b,key=lambda x:-x):
    if h <= 0 or B <= A:break
    h -= B
    ans += 1
print(math.ceil(h/A) + ans)
# Judge status: Accepted
from collections import defaultdict

D = defaultdict(int)

N = int(input())

x = N
y = 2
while y*y <= x:
    while x % y == 0:
        D[y] += 1
        x //= y
    y += 1
if x > 1:
    D[x] += 1

res = 0
for k, v in D.items():
    i = 1
    c = 0
    v -= 1
    while v >= 0:
        c += 1
        i += 1
        v -= i
    res += c

print(res)
# Judge status: Accepted
n=int(input())
t,a=map(int,input().split())
h=[t-int(x)*0.006 for x in input().split()]
ans=0
mn=10**18
for i,hi in enumerate(h):
  t=abs(hi-a)
  if t<mn:
    mn=t
    ans=i+1
print(ans)
# Judge status: Wrong Answer
N = int(input())

s = []

for i in range(N):
  moji = input()
  mojilist = list(moji).sort
  s.append(mojilist)
ans = 0
for i in range(N-1):
  for j in range(i+1, N):
    if s[i] == s[j]:
      ans += 1
print(ans)
# Judge status: Wrong Answer
import itertools
 
N = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

a = 0
b = 0
for i, x in  enumerate(itertools.permutations(range(1, N + 1))):
    print(i, x)
    if x == p:
        a = i
    if x == q:
        b = i
print(abs(a - b))
# Judge status: Accepted
import sys

def solve():
    input = sys.stdin.readline
    X, Y = map(int, input().split())
    length = 1
    while X * 2 <= Y:
        length += 1
        X *= 2
    print(length)

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
from itertools import accumulate

N = int(input())

S = []
for _ in range(N):
  S.append(int(input()))

if sum(S)%10 != 0:
  print(sum(S))
  exit()  
  
S.sort()

T = list(accumulate(S))

for i,v in enumerate(T):
  if v%10 != 0:
    print(T[-1]-S[i])
    exit()
    
print(0 if T[-1]%10 == 0 else T[-1])
# Judge status: Accepted
N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**10 for i in range(N)]
dp[0]=0
for i in range(N-1):
    for j in range(1,K+1):
        if i<N-j:
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))
print(dp[N-1])
# Judge status: Accepted
A, B, C = map(int, input().split())

print(min([B//A, C]))
# Judge status: Wrong Answer
a = [input() for i in range(2)]
if True != ("1" in a):
  print(1)
elif "True" != ("2" in a):
  print(2)
else:
  print(3)
# Judge status: Wrong Answer
from math import pi

c = float(input())
print(c / (3.0 * pi))
# Judge status: Accepted
# https://atcoder.jp/contests/agc003/tasks/agc003_a

s = input()
d = dict(N=0, W=0, S=0, E=0)

for i in range(len(s)):
    d[s[i]] += 1

if (d['N'] == 0 and d['S'] != 0) or (d['N'] != 0 and d['S'] == 0) or (d['W'] == 0 and d['E'] != 0) or (d['E'] == 0 and d['W'] != 0):
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a=map(lambda x:x//400,a)
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z.append(i)
print(min(8,len(set(z))),len(set(z))+cnt)
# Judge status: Accepted
import sys

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

X, Y = inm()


def solve():
    ans = 1 << 40
    for x, y, c in [(X, Y, 0), (-X, Y, 1), (X, -Y, 1), (-X, -Y, 2)]:
        if x <= y:
            ans = min(ans, c + y - x)

    return ans


print(solve())
# Judge status: Wrong Answer
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
while a!=0:
  c=a
  a=b%a
  b=c
ans=0
for i in range(2,int(math.sqrt(b)+2)):
  if b%i==0:
    ans+=1
    while b%i==0:
      b=int(b/i)
  if b!=1:
    ans+=1
print(ans+1)
# Judge status: Accepted
n = int(input())
ans = int(n/1.08)

for i in range(2):
    if int(ans*1.08) == n:
        print(ans)
        exit()
    ans += 1

print(":(")
# Judge status: Accepted
numal=lambda c:chr(c+97)
n=int(input())
unchi=[[],[],[],[],[],[],[],[],[],[]]
unchi[0].append("0")
k=1
if n>=2:
	while k<n:
		for i in range(len(unchi[k-1])):
			t=max(map(int, unchi[k-1][i]))
			for u in range(t+2):
				unchi[k].append(unchi[k-1][i]+str(u))
		k+=1
for i in range(len(unchi[n-1])):
	s = []
	for k in range(n):
		s.append(numal(int(unchi[n-1][i][k])))
	print("".join(s))
# Judge status: Accepted
from sys import stdin
import sys

N = int(stdin.readline().rstrip())

for i in range(26):
    if N < 4 * i:
        break
    if (N - 4 * i) % 7 == 0:
        print("Yes")
        sys.exit()


print("No")
# Judge status: Wrong Answer
s = input()
t = input()

ans = 10000
len_t = len(t)
for i in range(len(s) - len_t):
    ans_tmp = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            ans_tmp += 1
    ans = min(ans, ans_tmp)
print(ans)
# Judge status: Accepted
def main():
    l, r, d = map(int, input().split())
    ans = 0
    for i in range(l, r + 1):
        if i % d == 0:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
#c
import sys
n = int(input())
import math

ans = 0
for i in range(1,n):
    before = n
    for j in range(1,n):
        if before <= j:
            print(j)
            break
        if (n-i)%j==0 :
            
            
            if j==(n-i)/j:
                ans+=1
            else:
                ans+=2
        before = (n-i)/j
print(ans)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    n, m = map(int, readline().split())
    div = []
    for i in range(1, int(m**0.5)+1): 
        if m%i == 0:
            div.append(i)
            div.append(m//i)

    ans = 0
    for d in div:
        if m//n >= d:    
            ans = max(ans, d)
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
N,K = [int(i) for i in input().split()]
D = sorted([int(i) for i in input().split()],reverse=True)

def is_ok(x):
  while x!=0:
    if x%10 in D:
      return False

    x //=10

  return True

while True:
  if is_ok(N):
    print(N)
    break
  N+=1
# Judge status: Wrong Answer
n = int(input())
lst = [int(i) for i in input().split()]
last_value = lst[-1]
if sum([1 if i > last_value + 1 else 0 for i in lst]) > 0:
	print ('No')
else:
	print ('Yes')
# Judge status: Accepted
import heapq
n,m = map(int,input().split())
a = list(map(lambda x: int(x)*(-1),input().split()))

heapq.heapify(a)
for i in range(m):
     s = heapq.heappop(a)
     heapq.heappush(a,(-1)*(-s//2))
print(-sum(a))
# Judge status: Wrong Answer
S=input()
a=len(S)
s=0
t=0
for i in range(a):
  if i%2==0 and S[i]==1:
    s=s
  elif i%2==0 and S[i]==0:
    s+=1
  elif i%2!=0 and S[i]==0:
    s=s
  else:
    s+=1
for j in range(a):
  if j%2==0 and S[j]==0:
    t=t
  elif j%2==0 and S[j]==1:
    t+=1
  elif j%2!=0 and S[j]==1:
    t=t
  else:
    t+=1
m=min(s,t)
print(m)
# Judge status: Wrong Answer
s = input()
if 'hi' not in s:
    print('No')
elif 'hi' in s and 'hii' in s:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = input()
l = sorted(list({s[i] for i in range(len(s))}))
ans = ("a" if l[0] != "a" else "b")
if len(l) == 26:
    ans = "None"
else:
    for i in range(len(l) - 1):
        if ord(l[i]) + 1 != ord(l[i + 1]):
            ans = chr(ord(l[i]) + 1)
            break
print(ans)
# Judge status: Wrong Answer
S = input()
num = ""
l = len(S)
dis = float("inf") 

for i in range(l-2):
    num = S[i:i+3]
    if abs(787-int(num)) < dis:
        dis = abs(753-int(num))
        
for i in range(l-2):
    num = S[i+3:i:-1]
    if abs(787-int(num)) < dis:
        dis = abs(753-int(num))
        
        
print(dis)
# Judge status: Accepted
import sys 
sys.setrecursionlimit(4100000)

N = int(input())

def dfs(i,s):
    if len(s) == N:
        
        return print(s)
    
    for x in range(97,i + 1):
        t = s + chr(x)
        
        dfs(max(x + 1,i),t)
    
    
dfs(ord("a"),"")
# Judge status: Wrong Answer
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors + upper_divisors[::-1])

n=int(input())
s=1
for i in range(2,n+1):
  s=s+i*make_divisors(n)

print(s)
# Judge status: Wrong Answer
n,k = map(int, input().split())
r,s,p = map(int, input().split())
T = input()
P = []
for i in range(n):
    if T[i] == 'r':
        P.append(p)
    elif T[i] == 's':
        P.append(r)
    elif T[i] == 'p':
        P.append(s)
    else:
        print(4)

for i in range(n-k):
    if P[i] == P[i+k]:
        P[i+k] = 0

print(sum(P))
# Judge status: Accepted
from math import pi
def solve():
    R = int(input())
    print(R*2*pi)
if __name__ == '__main__':
    solve()
# Judge status: Accepted
n,m,x=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
add=[]
for i in range(2**n):
    skill=[0]*(m+1)
    for j in range(n):
        if ((i>>j)&1):
            skill=list(map(sum,zip(skill,l[j])))
    if min(skill[1:])>=x:
        add.append(skill)
if add:
    add.sort()
    print(add[0][0])
else:
    print(-1)
# Judge status: Accepted
N, Y = map(int, input().split())
ans = 0
a = 0
b = 0
c = 0
for a in range(N+1):
    for b in range(N-a+1):
        c = N - a - b
        if (a*10000 + b*5000 + c*1000) == Y:
            ans = 1
            x = a
            y = b
            z = c
            break
if ans == 1:
    print(x,y,z)
else:
    print( '-1 -1 -1')
# Judge status: Wrong Answer
n = int(input())
d = [list(map(int, input().split())) for _ in range(n)]

for i in range(n - 2):
  if all([d[i + j][0] == d[i + j][1] for j in range(2)]):
    print('Yes')
    exit()

print('No')
# Judge status: Accepted
S = input()
T = input()

for i in range(len(S)-len(T)+1)[::-1]:
    tmp = S[i:i+len(T)]
    flag = True

    for j in range(len(T)):
        if tmp[j]!=T[j] and tmp[j]!='?':
            flag = False
            break

    if flag:
        w = S[:i] + T + S[i+len(T):]
        w = w.replace('?', 'a')
        print(w)
        exit()

print('UNRESTORABLE')
# Judge status: Accepted
N = int(input())
n = list(input() for i in range(N))
a= 0
b=0
c=0
d=0
for i in n:
    if i == "AC":
        a = a+1
    elif i=="WA":
        b = b+1
    elif i=="TLE":
        c = c+1
    elif i== "RE":
        d = d+1
print("AC x", a)
print("WA x", b)
print("TLE x", c)
print("RE x", d)
# Judge status: Wrong Answer
import collections

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

ac = collections.Counter(a)
ans = 0

for i in a:
    if ac[i] < i:
        ans += ac[i]
    else:
        ans += ac[i] - i

print(ans)
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(tuple(map(int, input().split())), dtype=np.int64) - np.arange(N) - 1
median = np.median(A)
if int(median * 2) & 1:
    print(int(min(np.abs(A - median + 0.5).sum(), np.abs(A - median - 0.5).sum())))
else:
    print(int(np.abs(A - median).sum()))
# Judge status: Wrong Answer
N=int(input())

for i in range(N,1000):
  a=N//100
  c=N%10
  b=N-(100*a + c)
  if a==b==c:
    print(i)
    break
# Judge status: Wrong Answer
import collections
n = int(input())
a = list(input())
b = collections.Counter(a)
ans =b['R']*b['G']*b['B']
print(b,ans)
for i in range(n-2):
    for j in range(i+1,n-1):
        if a[i] == a[j]:
            continue
        c = j*2 -i
        if c < n:
            if a[i] != a[j] and a[i] != a[c] and a[j] != a[c]:
                ans -= 1
print(ans)
# Judge status: Accepted
n, r = map(int, input().split())

print(r if n >= 10 else r + 100 * (10 - n))
# Judge status: Accepted
a = input()
if a[0] == "9" or a[1] == "9":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x, y, a, b, c = map(int, input().split())

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

A = sorted(A)
B = sorted(B)
C = sorted(C)

t = 0
s = 0

for i in range(c):
    if A[t] < B[s] and A[t] < C[i]:
        A[t] = C[i]
        t += 1
    elif B[s] < A[t] and B[s] < C[i]:
        B[s] = C[i]
        s += 1
print(sum(A[-x:]) + sum(B[-y:]))
# Judge status: Accepted
X,Y=map(int,input().split())
print(X+Y//2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
dict = {}
dict[0] = 0
dict[1] = 0

for i in range(2,n+2):
  if i not in dict:
    dict[i] = 1
  else:
    dict[i] += 1
    
dict[len(dict)] = 0
dict[len(dict)] = 0
ans = 0

for j in range(len(dict)-2):
  ans = max(ans,dict[j]+dict[j+1]+dict[j+2])
  
print(ans)
# Judge status: Accepted
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
a=input()
ans=0
x=0
for i in a:
    if(i=='I'):
        x+=1
    else:
        x-=1
    ans=max(ans,x)
print(ans)
# Judge status: Wrong Answer
n = int(input())
for i in range(30):
  f = 4*i
  for j in range(30):
    s = 7*j
    if f > 0 and n%f == 0:
        print('Yes')
        quit()
    if s > 0 and n%s == 0:
        print('Yes')
        quit()
    if f > 0 or s > 0 and n%(f+s)==0:
        print('Yes')
        quit()
    if n < f+s:
        break
print('No')
# Judge status: Accepted
n=int(input())
print((800*n)-200*(n//15))
# Judge status: Accepted
import collections
s = input()
c = collections.Counter(s)
most_c = c.most_common()
if len(most_c) == 2 and most_c[0][1] == 2 and most_c[1][1] == 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = list(input())
k = int(input())
number = 0
for i in range(len(s)):
    if s[i] == "1" and i == k - 1:
        print(i + 1)
        exit()
    elif s[i] != "1" and number == 0:
        number = s[i]
print(number)
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))

flg =[0]*n

cnt=0
for i in range(n-1):
    if p[i]==i+1 and p[i+1]==i+2:
        cnt+=1
        flg[i]=1
        flg[i+1]=1

    elif flg[i]==0 and p[i]==i+1 and p[i+1]!=i+2:
        cnt+=1

if n>=3:
    if p[n-2]!=n-1 and p[n-1]==n:
        cnt+=1

print(cnt)
# Judge status: Wrong Answer
# import sys
# sys.setrecursionlimit(10**5)
# from collections import defaultdict
geta = lambda fn: list(map(fn, input().split()))
gete = lambda fn: fn(input())

def main():
    N, K = geta(int)
    h = geta(int)

    dp = [0]*N
    dp[0], dp[1] = 0, abs(h[0] - h[1])

    for i in range(2, N):
        lb = max(0, i-K)
        for j in range(lb, i):
            dp[i] = min(dp[i], dp[j] + abs(h[i]-h[j]))

    print(dp[-1])

if __name__ == "__main__":
    main()
# Judge status: Accepted

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    S=input()
    
    ans=0
    now="A"
    for i in range(N):
        if S[i]==now:
            ans+=1
        now=S[i]
    
    ans=(min(N-1,ans+K*2))
    print(ans)
        

main()
# Judge status: Accepted
h = int(input())

count = 0
while h != 0:
    h = int(h/2)
    count += 1

ans = 0
for i in range(count):
    ans += 2**i
  
print(ans)
# Judge status: Wrong Answer
s = input()
length = 4 # fixed

ans = 0
for bit in range(1<<(length-1)):  # for bit in range(2 ** (length-1)):
  p = []
  f = s[0]
  for i in range(length-1): 
    if bit & (1 << i):   # 0はプラス、1はマイナス
      p.append(i)
      f += "_-"
    else:
      f += "_+"
    f += s[i + 1]
  # print('d:',f)
  ans = sum(map(int, f.split("_")))
  
  if ans == 7:
    print(f.replace('_','')+'=7')
# Judge status: Accepted
k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print(s[:k]+'...')
# Judge status: Accepted
n=int(input())
a=int(input())
f,v,w=0,a,a
a=int(input())
if a>=v:
    w,v,f=v,a,1
else:
    w=a
for i in range(2,n):
    a=int(input())
    if a>=v:
        w,v,f=v,a,i
    elif a>=w:
        w=a
for i in range(n):
    if i==f:
        print(w)
    else:
        print(v)
# Judge status: Accepted
s = input()
s = s.split("/")

if int(s[0]) >= 2019 and int(s[1]) >= 5:
  print("TBD")
else:
  print("Heisei")
# Judge status: Wrong Answer
n = int(input())
a = input().split(" ")
b = set(a)
if len(b)<len(a):
  answer = "NO"
else:
  answer = "Yes"
print(answer)
# Judge status: Accepted
S = [list(map(int,input().split()))for i in range(3)]
check = False
for i in range(101):
  for j in range(101):
    if (S[0][0]-i == S[1][0]-j and S[0][1]-i == S[1][1]-j) and S[0][2]-i == S[1][2]-j:
      if (S[2][0]-S[0][0] == S[2][1]-S[0][1])and(S[2][0]-S[0][0] == S[2][2]-S[0][2]):
        check = True
        print('Yes')
        exit()
if check == False: print('No')
# Judge status: Accepted
#A
s = input()
count_dict = dict()

for word in s:
    count_dict.setdefault(word,0)
    count_dict[word] += 1
    
if len(count_dict) == 2:
    for row in count_dict:
        if count_dict[row] != 2:
            print("No")
            break
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m=map(int,input().split())
A=set(int(input()) for i in range(m))
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in A:dp[i]=0
print(dp[n])
# Judge status: Wrong Answer
l= list(map(int, input().split()))
l.sort
a=l[0]+l[1]
print (a)
# Judge status: Accepted
from math import sqrt,ceil,floor
def mi():return map(int,input().split())
def li():return list(mi())
def ii():return int(input())

n,k=mi()
m=[0]*(n+1)
for i in range(k):
    d=ii()
    a=li()
    for i in a:
        m[i]+=1
        
m=m[1:]
print(m.count(0))
# Judge status: Wrong Answer
n,x=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
ans=0
for a in A:
  x-=a
  if x>=0:
    ans+=1
  else:
    print(ans)
    break
# Judge status: Wrong Answer
n = int(input())
H = list(map(int, input().split()))
inf = 10**10
cost = [None]*n
h1 = [None]*(n-1)
h2 = [None]*(n-2) 
one_ago = H[1]
two_ago = H[0]
h1[0] = abs(two_ago-one_ago)
for i in range(1, n-1):
    new = H[i]
    h1[i] = abs(one_ago-new)
    h2[i-1] = abs(two_ago-new)
    two_ago, one_ago = one_ago, new
cost[0], cost[1] = 0, h1[0]
for i in range(2, n):
    cost[i] = min(cost[i-2]+h2[i-2], cost[i-1]+h1[i-1])
print(cost[n-1])
# Judge status: Accepted

r=int(input())
d=360
while d%r!=0:
    d+=360
print(d//r)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
l = [i for i in L if i != max(L)]
print('Yes' if max(L) < sum(l) else 'No')
# Judge status: Accepted
k = int(input())
s = str(input())
if len(s) <= k:
    print(s)
else:
    print(s[0:k] + '...')
# Judge status: Wrong Answer
x, y, z = list(map(str, input().split()))
s = z + x + y
print(s.split(' '))
# Judge status: Wrong Answer
a, b, c = input().split()

print("No" if a == b == c else "Yes")
# Judge status: Wrong Answer
print("YENOS"[max(int(input().replace(" ",""))%4,1)::2])
# Judge status: Wrong Answer
def main():
    a,b = map(int, input().split())
    if a>=13:
        print(b)
    elif 6<=a<=12:
        print(b/2)
    else:
        print(0)
main()
# Judge status: Accepted
def comb_mod(n,r):
    mod = 10**9+7
    ans = 1
    for i in range(r):
        ans *= n-i
        ans %= mod
    for i in range(1,r+1):
        ans *= pow(i,mod-2,mod)
        ans %= mod
    return ans

def solve():
    n, a, b = map(int, input().split())
    mod = 10**9+7
    ans = pow(2,n,mod)-comb_mod(n,a)-comb_mod(n,b)-1
    ans %= mod
    return ans
print(solve())
# Judge status: Accepted


import numpy as np


print("Yes"if('9' in input()) else "No")
# Judge status: Accepted
#!/usr/bin/env python3

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

if A%3 == 0 or B%3 == 0 or (A+B)%3 == 0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
cnt = 0

for i in range(0, n):
    if (i+1) != p[i]:
        cnt += 1

if cnt < 3:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
d4=len([i for i in A if i%4==0])
d2=len([i for i in A if i%2==0 and i%4!=0])

N=N-d4*3
if N==1 and d2>=2:
    N=0
elif N>=2 and N-d2<=0:
    N=0

print("Yes" if N<=0 else "No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

count = [0]*(max(a)+1)
for i in a: count[i]+=1

if len(count) <= 2:
  print(sum(count))
  exit()
  
ans = 0
for i in range(2,max(a)):
  if count[i-1]+count[i]+count[i+1] > ans:
    ans = count[i-1]+count[i]+count[i+1]
print(ans)
# Judge status: Wrong Answer
import fractions
N,M = map(int,input().split())
A = [int(i)//2 for i in input().split()]

gcd = 1
for i in A:
    gcd = gcd * i//fractions.gcd(gcd,i)

ans = M//gcd
ans = (ans+1)//2
print(ans)
# Judge status: Accepted
n = int(input())
for i in range(50000):
    tmp=i*1.08//1
    if tmp==n:
        print(i)
        exit(0)
print(":(")
# Judge status: Accepted
s = list(input())
t = list(input())

s.sort()
t.sort(reverse=True)

if ''.join(s) < ''.join(t):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

ans = 'APPROVED'
for i in range(N):
    if A[i]%2 == 0:
        if A[i]%3 != 0 and A[i]%5 != 0:
            ans = 'DENIED'
            break
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    nums = list(map(int, input().split())) 
    exist_odd = False
    result = 0
    while True:
        for i in range(n):
            if nums[i] % 2 != 0:
                exist_odd = True
        if exist_odd:
            break
        nums = list(map(lambda x: x / 2, nums))
        result += 1
    print(result)
if __name__ == '__main__':
    main()
# Judge status: Accepted
A,B = list(map(int,input().split()))
print(A+B//2)
# Judge status: Accepted
def im(a):
    imos = [0] * (3*N+1)
    for i in range(N):
        imos[N+i-min(N,a[i])] += 1
        imos[N+i+min(N,a[i])+1] -= 1
    cs = [0]
    for i in range(1,2*N+1):
        cs.append(cs[i-1]+imos[i-1])
    return cs[N+1:]

N,K,*A = map(int, open(0).read().split())
for i in range(K):
    A = im(A)
    if A.count(N) == N:
        break
print(*A)