Harryxun/stf_run huggingface dataset:
def my_index(l, x, default=0):
    if x in l:
        return l.index(x)
    else:
        return default


T=list("keyence")
x=0
j=0
S=input()
#print(my_index(S,"k"))
if my_index(S,"k")==0:
  for i in range(len(S)):
    if S[i]==T[j]:
      x=x+1
      #print(x)
      j=j+1
    else:
      #print("c")
      continue
  if x==7:
    print("YES")
  else:
    print("NO")    
else:
  for i in range(int(my_index(S,"k")),len(S)):
    if S[i]==T[j]:
      x=x+1
      #print(x,i)
      j=j+1
    else:
      print("NO")
      break
  if x==7:
    print("YES")

### FIXED CODE ###

A=["k","e","y","e","n","c","e"]
f=-1;p=0;q=0;r=0
S=list(map(str,input()))
if S[0:7]==A or S[len(S)-7:len(S)]==A:
  f=1
else:
  if S[0]!=A[0]:
    f=0
  else:    
    for i in range(len(S)):
      if S[i]==A[i]:
        p=p+1
      else:
        if A[0:p]+S[len(S)-(len(A)-p):len(S)]==A:
          #print(A[0:p]+S[len(S)-(len(A)-p):len(S)])
          f=1
          break
        else:
          f=0
          break
print("YES" if f==1 else "NO")
a, b = map(int, input().split())
if a > b:
    print ("a > b")
elif a == b:
    print ("a == b")
else :
    print ("a < b")

### FIXED CODE ###

a, b = map(int, input().split())
if a > b:
    print ("a > b")
elif a == b:
    print ("a == b")
else :
    print ("a < b")
h,a=map(int,input.split())
if h>a:
  print(h//a)
if h<a:
  print(1)

### FIXED CODE ###

h,a=map(int,input().split())
if h>a:
  if h%a==0:print(h//a)
  if h%a>0:print(h//a+1)
if h<=a:
  print(1)
r, g, b = map(int, input().split())
a = r * 100 + g * 10 + b
if a % 4 == 0:
    print('Yes')
else:
    pritn('No')

### FIXED CODE ###

r, g, b = map(int, input().split())
a = r * 100 + g * 10 + b
if a % 4 == 0:
    print('YES')
else:
    print('NO')
N = int(input())
AB = [int(input().split()) for _ in range(n)]
 
A = AB[::2]
B = AB[1::2]
 
A.sort()
B.sort()
 
if N % 2 == 0:
    n = N // 2
    med1 = A[n - 1] + A[n]
    med2 = B[n - 1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
 
print(x)

### FIXED CODE ###

N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
 
A = []
B = []
for i in range(N):
  A.append(AB[i][0])
  B.append(AB[i][1])
A.sort()
B.sort()
if N % 2 == 0:
    n = N // 2
    med1 = A[n-1] + A[n]
    med2 = B[n-1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
    
print(x)
Q=int(input())
n=10010
is_prime=[1]*(n+1)
is_prime[0]=0
is_prime[1]=0
for i in range(2,n+1):
	for j in range(i*2,n+1,i):
		if is_prime[j]==False:
			continue
		is_prime[j]=0
a=[0]*(n+1)
for i in range(2,n+1):
	if is_prime[i]%2==0:
		continue
	if is_prime[i] and is_prime[int((i+1)/2)]:
		a[i]=1
s=[0]*(n+1)		
for i in range(n):
	s[i+1]=a[i]+s[i]
for i in range(Q):
	l,r=map(int,input().split())
	print(s[r+1]-s[l])

### FIXED CODE ###

Q=int(input())
n=100000
is_prime=[1]*(n+10)
is_prime[0]=0
is_prime[1]=0
for i in range(2,n+1):
	for j in range(i*2,n+1,i):
		if is_prime[j]==False:
			continue
		is_prime[j]=0
a=[0]*(n+10)
for j in range(2,n+1):
	if is_prime[j]%2==0:
		continue
	if is_prime[j] and is_prime[int((j+1)/2)]:
		a[j]=1
s=[0]*(n+10)		
for k in range(n):
	s[k+1]=a[k]+s[k]
ans=[]
for _ in range(Q):
	l,r=map(int,input().split())
	ans.append(s[r+1]-s[l])
print(*ans,sep='\n')
import math
a, b = map(int,input().split())

def lcm(a, b):
    y = a*b / math.gcd(a, b)
    return int(y)

print(lcm(a,b))

### FIXED CODE ###

from fractions import gcd
a, b = map(int,input().split())

def lcm(a, b):
  return a * b // gcd (a, b)

print(lcm(a, b))
#n = int(input())
n,m = map(int,input().split())
#L= list(map(int, input().split()))
L = []
for i in range(m):
    a = list(map(int, input().split()))
    L.append(a)

if n == 1:
    print(0)
    exit()
if m == 0:
    print(-1)
s = [-1]*n
for i in range(m):
    s[L[i][0]-1] = L[i][1]
print(L,s)
if s[0] == 0:
    print(-1)
    exit()

for i in range(1,m):
    if s[i]==-1:
        s[i] = 0
    print(s)
ans = ""
for i in range(m):
    ans += str(s[i])
print(int(ans))

### FIXED CODE ###

n,m = map(int,input().split())
L = []
for i in range(m):
    L.append(list((map(int,input().split()))))

for i in range(1000):
    p = str(i)
    flag = False
    for j in range(m):
        if len(p) >= L[j][0]:
            if int(p[L[j][0]-1]) != L[j][1]:
                break
    else:
        if len(p) == n:
            flag = True

    if flag:
        print(i)
        exit()
print(-1)
import math
A B H M = map(int, input().split())
Mkaku = 6 * M
Hkaku = (H * 60 + M) / 2
d1 = abs(Mkaku - Hkaku)
d2 = 360 - d1
distance = min(d1, d2)
r = distance * math.pi / 180
v1x = A * math.cos(r)
v1y = A * math.sin(r)
v2x = B * math.cos(r)
v2y = B * math.sin(r)
ans = ((v1x - v2x) ** 2 + (v1y - v2y) ** 2) ** 1/2
print(ans)

### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())
Mkaku = 6 * M
Hkaku = (H * 60 + M) / 2
r1 = Hkaku * math.pi / 180
r2 = Mkaku * math.pi / 180
v1x = A * math.cos(r1)
v1y = A * math.sin(r1)
v2x = B * math.cos(r2)
v2y = B * math.sin(r2)
ans = ((v1x - v2x) ** 2 + (v1y - v2y) ** 2) ** (1 / 2)
print(ans)
a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())

if a<b:
    if b+w*t <= a+v*t:
        print('YES')
    else:
        print('NO')
else:
    if a-v*t <=	b-w*t:
	print('YES')
    else:
	print('NO')



### FIXED CODE ###

a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())

if a<b:
    if b+w*t <= a+v*t:
      print('YES')
    else:
      print('NO')
else:
    if a-v*t <=	b-w*t:
      print('YES')
    else:
      print('NO')
n = int(input())
v = list(map(int, input().split()))
ans = v[0]
for i in range(1, n):
    ans += max(v[i]-v[i-1], 0)
print(cnt)

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
ans = v[0]
for i in range(1, n):
    ans += max(v[i]-v[i-1], 0)
print(ans)
n, q = map(int, input().split())
g = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
xs = [0 for _ in range(n)]
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    xs[p] += x

costs = [0 for i in range(n)]
visited = [False for _ in range(n)]


def rec(prev_v, v, value):
    if visited[v]:
        return
    visited[v] = True
    next_value = value + xs[v]
    costs[v] = next_value
    for next_v in g[v]:
        if next_v == prev_v:
            continue
        rec(v, next_v, next_value)


rec(-1, 0, 0)
print(' '.join(map(str, costs)))



### FIXED CODE ###

import sys

n, q = map(int, sys.stdin.readline().split())
g = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, sys.stdin.readline().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
xs = [0 for _ in range(n)]
for i in range(q):
    p, x = map(int, sys.stdin.readline().split())
    p -= 1
    xs[p] += x

visited = [False for _ in range(n)]
# def rec(prev_v, v, value):
#     if visited[v]:
#         return
#     visited[v] = True
#     next_value = value + xs[v]
#     costs[v] = next_value
#     for next_v in g[v]:
#         if next_v == prev_v:
#             continue
#         rec(v, next_v, next_value)
# rec(-1, 0, 0)

current_node = [0]
while len(current_node) > 0:
    next_node = []
    for v in current_node:
        visited[v] = True
        for next_v in g[v]:
            if visited[next_v]:
                continue
            next_node.append(next_v)
            xs[next_v] += xs[v]
    current_node = next_node

print(' '.join(map(str, xs)))
sum=0
min=9
for i in range(5):
  y=int(input())
  x=y%10
  if x==0:
    sum+=y
  else:
    min=min(x, min)
    if x==min:

### FIXED CODE ###

X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(X)+sum(Y)-(max(Y)))
N, *A = map(int, open(0).read().split())

S = set(A)

A.sort(reverse=True)

ans = 0
for a in A:
    b = 2 ** a.bit_length() - a
    if a != b and b in S:
        S.remove(a)
        S.remove(b)
        ans += 1

print(ans)


### FIXED CODE ###

from collections import Counter

N, *A = map(int, open(0).read().split())

C = Counter(A)
A.sort(reverse=True)

ans = 0
for a in A:
    if C[a] == 0:
        continue
    C[a] -= 1

    b = 2 ** a.bit_length() - a
    if C[b] > 0:
        C[b] -= 1
        ans += 1

print(ans)
n = int(input())
a = map(int, input().split(" "))

color_types = [False]*7
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = True
	else:
		pro_count += 1
print(sum(color_types), min(8, sum(color_types)+pro_count))

### FIXED CODE ###

n = int(input())
a = map(int, input().split(" "))

color_types = [False]*8
pro_count = 0
for a_i in a:
	if a_i < 3200:
		color_types[a_i//400] = 1
	else:
		pro_count += 1
print(max(1, sum(color_types)), sum(color_types)+pro_count)
import itertools
import sys
import numpy as np
from collections import defaultdict
import bisect

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(input())
left = list(map(int, input().split()))

indices = defaultdict(list)
for i, x in enumerate(left):
    indices[x].append(i)


def dp(t, n1, n2, n3):
    cached = t.get((n1, n2, n3))
    if cached is not None:
        return cached
    remaining = n1 + n2 + n3
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    res = 0
    if last_cnt == n1:
        res += dp(t, n1 - 1, n2, n3)
        res %= M
    if last_cnt == n2:
        res += dp(t, n1, n2 - 1, n3)
        res %= M
    if last_cnt == n3:
        res += dp(t, n1, n2, n3 - 1)
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[n1, n2, n3] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = len(indices[i])
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, h[0], h[1], h[2])
    return res * len(set(itertools.permutations(h))) % M


print(solve())


### FIXED CODE ###

import itertools
import sys
from collections import Counter

sys.setrecursionlimit(10 ** 9)
M = 1000000007
N = int(sys.stdin.readline())
left = list(map(int, sys.stdin.read().split()))
counter = Counter(left)


def dp(t, ns):
    cached = t.get(ns)
    if cached is not None:
        return cached
    remaining = sum(ns)
    assert remaining > 0
    last_cnt = left[remaining - 1] + 1
    n1, n2, n3 = ns
    res = 0
    if last_cnt == n1:
        res += dp(t, tuple(sorted([n1 - 1, n2, n3])))
        res %= M
    if last_cnt == n2:
        res += dp(t, tuple(sorted([n1, n2 - 1, n3])))
        res %= M
    if last_cnt == n3:
        res += dp(t, tuple(sorted([n1, n2, n3 - 1])))
        res %= M
    # print(f"{remaining}: ({n1},{n2},{n3}) => {res}")
    t[ns] = res
    return res


def solve():
    h = [0, 0, 0]
    for i in range(N):
        k = counter[i]
        if k == 3:
            h[0] = h[1] = h[2] = i + 1
        elif k == 2:
            h[0] = h[1] = i + 1
        elif k == 1:
            h[0] = i + 1
        else:
            break
    if sum(h) != N:
        return 0
    t = dict()
    t[0, 0, 0] = 1
    res = dp(t, tuple(sorted(h)))
    return (res * len(set(itertools.permutations(h)))) % M


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

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
cmn = list(cmn_lst)
m = max(cmn)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for i, v in enumerate(hurui):
    if v == 1:
        cand.add(i)
print(len(cand & cmn_lst))

### FIXED CODE ###

from math import gcd
A, B = map(int,input().split())
max_cmn_div = gcd(A, B)

# 約数列挙関数
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**(1/2))+1):
        if n % i == 0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return divisor

def check_prime(n):
    for i in range(2, int(n**(1/2))+1):
        if n % i == 0:
            return 0
    return 1

cmn_div = make_divisor(max_cmn_div)
ans = 0
for i in cmn_div:
    if check_prime(i):
        ans += 1
print(ans)
n = int(input())
xy = []
ans = []

for i in range(n):
    xin,yin = map(int,input().split())
    xy.append([xin,yin])

xy.sort(key=lambda x:x[1])
xy.sort(key=lambda x:x[0])

for i in range(n):
    for j in range(i,n):
        if( i==j ):
            continue
        t = (xy[i][0]-xy[j][0],xy[i][1]-xy[j][1])
        ans.append(t)

res = [ans.count(e) for e in set(ans)]
print(n-max(res))

### FIXED CODE ###

n = int(input())
xy = []
ans = []

for i in range(n):
    xin,yin = map(int,input().split())
    xy.append([xin,yin])

if n==1:
    print(1)
    exit(0)

xy.sort(key=lambda x:x[1])
xy.sort(key=lambda x:x[0])

for i in range(n):
    for j in range(n):
        if( i==j ):
            continue
        t = (xy[i][0]-xy[j][0],xy[i][1]-xy[j][1])
        ans.append(t)

res = [ans.count(e) for e in set(ans)]
print(n-max(res))
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
kk=k
mx=0
while a[i]<=k:
    k-=a[i]
    i+=1
    mx+=1
j=0
while b[j]<=k:
    k-=b[j]
    j+=1
    mx+=1
cou=mx
while i>=0 and j<m:
    k+=a[i]
    i-=1
    cou-=1
    while j<m and b[j]<=k:
        j+=1
        k-=b[j]
        cou+=1
    mx=max(cou,mx)
print(mx)

### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
mx=0
lol=0
while i<n and a[i]<=k:
    k-=a[i]
    i+=1
    mx+=1
    lol=1
j=0
while j<m and b[j]<=k:
    k-=b[j]
    j+=1
    mx+=1
cou=mx

i-=1
while i>=0 and j<m:
    k+=a[i]
    i-=1
    cou-=1
    while j<m and b[j]<=k:
        k-=b[j]
        cou+=1
        j+=1
    mx=max(cou,mx)
print(mx)
N=int(input())
A=list(map(int,input().split()))


def lcm(x,y):
    pre_x=x
    pre_y=y
    if x<y:
        x,y=y,x
    while x%y !=0:
        x,y=y,x%y
    
    return pre_x*pre_y//y

thr=1

l=lcm(A[0],A[1])

for i in range(2,N):
    l=lcm(l,A[i])
    
ans=0
for i in range(N):
    ans+=l//A[i]

print(ans%(10**9+7))

### FIXED CODE ###


# from math import gcd
from fractions import gcd
from functools import reduce


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

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

l=reduce(lcm,A)
    
ans=0
for i in range(N):
    ans+=l//A[i]

print(ans%(10**9+7))
# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c

"""
import sys


def solve(N, positions):
    if N == 1:
        return positions[0]
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[0]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[1:]:
                hh = max(ph - abs(cy-y) - abs(cx-x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(input())
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c

"""
import sys


def solve(N, positions):
    if N == 1:
        return positions[0]
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[0]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[1:]:
                hh = max(ph - abs(cy-y) - abs(cx-x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[-1]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[:-1]:
                hh = max(ph - abs(cy-y) - abs(cx-x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(input())
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])
s=input()
if s=='RRR':
    print(3)
elif s=='RRS':
    print(2)
elif s=='RSR':
    print(1)
elif s=='SRR':
    pront(2)
elif s=='SSR':
    print(1)
elif s=='SRS':
    print(1)
elif s=='RSS':
    print(1)
else :print(0)
    


### FIXED CODE ###

s=input()

if 'RRR' in s:
    print(3)
elif 'RR' in s:
    print(2)
elif 'SSS' in s:
    print(0)
else :
    print(1)
N=int(input())
h=list(map(int,input().split()))

memo=[-1 for i in range(0,N)]
memo[-1]=0
memo[-2]=abs(h[-2]-h[-1])

def ans(num):
    if memo[num]!=-1:
        return memo[num]

    memo[num]=min(ans(num+1)+abs(h[num+1]-h[num]),ans(num+2)+abs(h[num+2]-h[num]))

    return memo[num]

print(ans(0))

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

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

memo=[-1 for i in range(0,N)]
memo[-1]=0
memo[-2]=abs(h[-2]-h[-1])

def ans(num):
    if memo[num]!=-1:
        return memo[num]

    memo[num]=min(ans(num+1)+abs(h[num+1]-h[num]),ans(num+2)+abs(h[num+2]-h[num]))

    return memo[num]

print(ans(0))
import math
import decimal
decimal.getcontext().prec = 22

#getcontext().prec=20
a,b,h,m=map(int,input().split())
a=decimal.Decimal(a)
b=decimal.Decimal(b)
h=decimal.Decimal(h)
m=decimal.Decimal(m)

#print(a,b,h,m)

ang1=decimal.Decimal(360*(h/12)+30*m/60)
ang2=decimal.Decimal(360*m/60)
ang=decimal.Decimal(abs(ang1-ang2))
#print(ang)
if ang>=180.0:
    ang=ang-180.0

#print(ang)
ans = ((a)**2 + (b)**2 - decimal.Decimal(2.0)*(a)*(b)*decimal.Decimal(math.cos(math.radians(ang))))
ans = (math.sqrt(ans))
#print(math.cos(math.radians(ang)))

print(ans)

### FIXED CODE ###

import math
#import decimal
#decimal.getcontext().prec = 12

#getcontext().prec=20
a,b,h,m=map(int,input().split())
#a=decimal.Decimal(a)
#b=decimal.Decimal(b)
#h=decimal.Decimal(h)
#m=decimal.Decimal(m)

#print(a,b,h,m)

#ang1=decimal.Decimal(360*(h/12)+30*m/60)
#ang2=decimal.Decimal(360*m/60)
#ang=decimal.Decimal(abs(ang1-ang2))
ang1=360*(h/12)+30*m/60
ang2=360*m/60
ang=abs(ang1-ang2)
#print(ang)
if ang>=180.0:
#    ang=ang-180.0
    ang=360.0-ang

#print(ang)
#ans = ((a)**2 + (b)**2 - decimal.Decimal(2.0)*(a)*(b)*decimal.Decimal(math.cos(math.radians(ang))))
ans = a**2 + b**2 - 2.0*a*b*math.cos(math.pi*ang/180.0)
ans = math.sqrt(ans)
#print(math.cos(math.radians(ang)))

print(ans)
import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = 0
aoki = 0



for i in range(N):
  A[i], B[i] = map(int,input().split())


D = list(np.array(A) + np.array(B))
for i in range(N):
  C[i] = [i, D[i]]




C = sorted(C, key=lambda x:x[1])



while len(C) > 0:
  tmp_max = C[-1][0]
  takahashi += A[tmp_max]
  A.pop(tmp_max)
  B.pop(tmp_max)
  C.pop(tmp_max)

  if len(C)>0 :
    tmp_max = C[-1][0]
    aoki += B[tmp_max]
    A.pop(tmp_max)
    B.pop(tmp_max)
    C.pop(tmp_max)

print(takahashi-aoki)







### FIXED CODE ###

#%%
import time

import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = []
aoki = []

start = time.time()

for i in range(N):
  A[i], B[i] = map(int,input().split())


D = np.array(A) + np.array(B)
for i in range(N):
  C[i] = [i, D[i]]


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()

C = sorted(C, key=lambda x:x[1])


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()


if N %2 == 0 :
  for i in range(1,N,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])

elif N %2 != 0 :
  for i in range(1,N-1,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])
  tmp_max = C[-N][0]
  takahashi.append(A[tmp_max])

print(sum(takahashi)-sum(aoki))

elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
import sys, math

n = int(input())
s = int(input())

def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b

if s == n:
    print(n + 1)
    sys.exit()
elif s > n:
    print('-1')
    sys.exit()

sqrt_n = math.floor(math.sqrt(n))

for b in range(2, sqrt_n + 1):
    if f(b, n) == s:
        print(b)
        sys.exit()

for p in range(1, sqrt_n + 1):
    P = sqrt_n + 1 - p
    b = int( (n -s)/P ) + 1
    if f(b, n) == s and b >= 2:
        print(b)
        sys.exit()

print('-1')

### FIXED CODE ###

import sys, math
n = int(input())
s = int(input())

def f(b, n):
    if n < b:
        return n
    else:
        return f(b, n//b) + n % b

if s == n:
    print(n + 1)
    sys.exit()

sqrt_n = math.floor(math.sqrt(n))
for b in range(2, sqrt_n + 1):
    if f(b, n) == s:
        print(b)
        sys.exit()
for p in range(1, sqrt_n + 1):
    p_sum= sqrt_n + 1 - p
    b = int( (n -s)/p_sum ) + 1
    if b >= 2 and f(b, n) == s:
        print(b)
        sys.exit()
print('-1')
a, b) = [int(i) for i in input().split()]
 
while True:
    d = a // b
    r = a % b
    f = a / b
    print( '{0:d} {1:d} {2:.5f}'.format( d, r, f))
    break

### FIXED CODE ###

(a, b) = [int(i) for i in input().split()]
  
while True:
    d = a // b
    r = a % b
    f = a / b
    print( '{0:d} {1:d} {2:.5f}'.format( d, r, f))
    break
N, K = input().split()
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K+1]))


### FIXED CODE ###

N, K = map(int,input().split())
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K]))
#include <iostream>

int main(){
    int a, b;
    std::cin >> a >> b;
    if(a>=1 && b<=100){
        std::cout << a*b << " " << 2*(a+b);
    }
    return 0;
}


### FIXED CODE ###

a,b = map(int, input().split())
print(a*b, 2*(a+b))
N = int(input())
ans = 1
for i in range(2,i+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)

### FIXED CODE ###

N = int(input())
ans = 1
for i in range(2,N+1):
  ans = ans * i % (10 ** 9 + 7)

print(ans)
N, K = (int(x) for x in input().split())

if (K == 1):
    print("0")
else:
    print(N - K)


### FIXED CODE ###

N, K = (int(x) for x in input().split())

if (K == 1):
    print("0")
else:
    print(N - K)
N = int(input())
sum = 0
for i  in N:
  sum + i = sum
print(sum)

### FIXED CODE ###

N = int(input())
sum = 0
for i in range(0,N+1):
  sum+=i
print(sum)
n = int(input())
lst = list(map(int, input().split()))
count = 0

for i in range(1, n + 1, 2):
  if lst[i] % 2 == 0:
    count += 1
    
print(count)

### FIXED CODE ###

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

for i in range(0, n, 2):
  if lst[i] % 2 != 0:
    count += 1
    
print(count)
x,y = map(int,input().split())

if x2 == y:
  print('Yes')
  exit()

if x4 == y:
  print('Yes')
  exit()

for i in range(1,x+1):
  if (x-i)2 + i4 == y:
    print('Yes')
    exit()
  if (x-i)4 + i*2 == y:
    print('Yes')
    exit()

print('No')

### FIXED CODE ###

x,y = map(int,input().split())

if x*2 == y:
  print('Yes')
  exit()

if x*4 == y:
  print('Yes')
  exit()

for i in range(1,x+1):
  if (x-i)*2 + i*4 == y:
    print('Yes')
    exit()
  if (x-i)*4 + i*2 == y:
    print('Yes')
    exit()

print('No')