Harryxun/stf_run huggingface dataset:
class RSQ:
    def __init__(self, length, ini_num = float("inf")):
        self.length = 1
        self.ini_num = ini_num
        if length == 1:
            length = 2
        while self.length < length:
            self.length <<= 1
        self.segtree = [ini_num] * (2 * self.length - 1)

    def update(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] = num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def add(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] += num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def call_search(self, a, b):
        return self.search(a, b, index = 0, l = 0, r = self.length - 1)

    def search(self, a, b, index, l, r):
        if a <= l <= r <= b:
            return self.segtree[index]
        elif r < a or b < l:
            return self.ini_num
        else:
            return self.search(a, b, index * 2 + 1, l, (l + r) // 2) + self.search(a, b, index * 2 + 2, (l + r) // 2 + 1, r)

v_num, query = map(int, input().split(" "))
rsq = RSQ(v_num, 0)
for _ in range(query):
    comm, index, num = map(int, input().split(" "))
    if comm == 0:
        rsq.add(index, num)
    else:
        print(rsq.call_search(index, num))

### FIXED CODE ###

class RSQ:
    def __init__(self, length, ini_num = float("inf")):
        self.length = 1
        self.ini_num = ini_num
        if length == 1:
            length = 2
        while self.length < length:
            self.length <<= 1
        self.segtree = [ini_num] * (2 * self.length - 1)

    def update(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] = num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def add(self, index, num):
        leaf_index = index + self.length - 1
        self.segtree[leaf_index] += num
        while leaf_index > 0:
            leaf_index = (leaf_index - 1) // 2
            self.segtree[leaf_index] = self.segtree[2 * leaf_index + 1] + self.segtree[2 * leaf_index + 2]

    def call_search(self, a, b):
        return self.search(a, b, index = 0, l = 0, r = self.length - 1)

    def search(self, a, b, index, l, r):
        if r < a or b < l:
            return self.ini_num            
        elif a <= l <= r <= b:
            return self.segtree[index]
        else:
            return self.search(a, b, index * 2 + 1, l, (l + r) // 2) + self.search(a, b, index * 2 + 2, (l + r) // 2 + 1, r)

v_num, query = map(int, input().split(" "))
rsq = RSQ(v_num, 0)
for _ in range(query):
    comm, index, num = map(int, input().split(" "))
    if comm == 0:
        rsq.add(index - 1, num)
    else:
        print(rsq.call_search(index - 1, num - 1))
import math
n=int(input())
l=list(map(int,input().split()))
dp=[math.inf for _ in range(n)]
dp[0]=0
dp[1]=abs(l[1]-l[0])

for i in range(2,n):
    single=abs(l[i]-l[i-1])+dp[i-1]
    double=abs(l[i]-l[i-2])+dp[i-2]
    dp[i]=min(single,double)

print(dp[n-1])

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
dp=[0 for _ in range(n)]
dp[1]=abs(l[1]-l[0])

for i in range(2,n):
    single=abs(l[i]-l[i-1])+dp[i-1]
    double=abs(l[i]-l[i-2])+dp[i-2]
    dp[i]=min(single,double)

print(dp[n-1])
n = int(input())
a  =[]
for i in range(n):
  a.append(int(inpit())
ma = max(a)
b = sorted(a)
for i in range(n):
  if a[i] != ma:
    print(ma)
  else:
    print(b[-2])
    
  


### FIXED CODE ###

n = int(input())
a  =[]
for i in range(n):
  x = int(input())
  a.append(x)
ma = max(a)
b = sorted(a)
for i in range(n):
  if a[i] != ma:
    print(ma)
  else:
    print(b[-2])
s=list(map(int,input().split()))
i=1
while true:
	if s[i-1]==0:
		break
	else
		print('Case '+str(i)+': '+str(s[i-1]))
		i+=1

### FIXED CODE ###

n=[]
line=''
while line != '0':
    line=input()
    if line != '0': n.append(int(line))
for x in range(len(n)): print('Case %d: %d'%(x+1, n[x]))
N = int(input())
T, A = map( int, input().split())
H = list( map( int, input.split()))
         
K = []
Ksorted=[]
tmp=[]
 
for i in range(N):
  tmp.append( T - H[i] * 0.006)
  K.append(abs( A - tmp[i]))
  Ksorted = sorted(K)
  
T = K.index(Ksorted[0])
print(T+1)

### FIXED CODE ###

x, y = map( int, input().split())
print( int( x + y/ 2))
n=int(input())
li = list(map(int,input().split()))
count=0

for i in range(100):
  for j in range(n):
    if i == j:pass
    elif li[i]%li[j] == 0:break
    elif j == n-1:count +=1

print(count)

### FIXED CODE ###

x,n = map(int,input().split())
if n == 0:print(x)
else:
  li = list(map(int,input().split()))

  for i in range(100):
    plus = (x+i)  in li
    minus = (x-i)  in li
  
    if plus == 1 and minus == 1:
      pass  
    elif plus == 1 and minus == 0:
      print(x-i)
      break
    elif plus == 0 and minus == 1:
      print(x+i)
      break
    else:
      print(x-i)
      break
a,b,c,d,e=int(input().split())
0 2 3 4 5
print(15-a-b-c-d-e)

### FIXED CODE ###

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

print(15-a-b-c-d-e)
S = input()
SS = S/500
SSS = (S%500)/5
print(1000*SS + 5*SSS)

### FIXED CODE ###

S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')
L, R = input().split()
s = (R - 1) // ( L - 1)
ans = s + 1
print(ans)

### FIXED CODE ###

L, R = map(int, input().split())
s = (R - 1) // (L - 1)
r = (R - 1) % (L - 1)
if r == 0:
  ans = s
else:
  ans = s + 1
print(ans)
# from functools import reduce

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

R = reduce(lambda x, y: x and y, [n % 3 == 0 or n % 5 == 0 for n in AL if n % 2 == 0])

if R:
    print('APPROVED')
else:
    print('DENIED')



### FIXED CODE ###

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

if len(set([A, B, C])) == 2:
    print('Yes')
else:
    print('No')
from math import floor
from decimal import Decimal
a, b = map(Decimal, input().split())
print(math.floor(a*b))

### FIXED CODE ###

from math import floor
from decimal import Decimal
a, b = map(Decimal, input().split())
print(floor(a*b))
import math

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

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

print(lcm(A, B))

### FIXED CODE ###

from fractions import gcd

def saisyou(x, y):
    ans =  (x * y) // gcd(x, y)
    print(ans)

A,B = map(int, input().split())
saisyou(A,B)
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A,B,C = map(int, readline().split())
if (A == B and B != C) or (B == C and C != A)  (A == C and C != B):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A,B,C = map(int, readline().split())
if (A == B and B != C) or (B == C and C != A) or (A == C and C != B):
    print('Yes')
else:
    print('No')
input_str = int(input())
num = 0
for str in input_str:
    if str == '+':
        num += 1
    else:
        num -= 1
print(num)

### FIXED CODE ###

input_str = input()
num = 0
for str in input_str:
    if str == '+':
        num += 1
    else:
        num -= 1
print(num)
n=input()
a=map(int,raw_input().split())
a.reverse()
print(' '.join(a))

### FIXED CODE ###

n=input()
a=map(str,raw_input().split())
a.reverse()
print(' '.join(a))
# usr/bin/python
# coding: utf-8
################################################################################
# Is it a Right Triangle?
# Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so.
#
# Input
# Input consists of several data sets. In the first line, the number of data set, N is given. Then, N lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
#
# Constraints
# 1 ??? length of the side ??? 1,000
# N ??? 1,000
# Output
# For each data set, print "YES" or "NO".
#
# Sample Input
# 3
# 4 3 5
# 4 3 6
# 8 8 8
# Output for the Sample Input
# YES
# NO
# NO
#
################################################################################

import fileinput

if __name__ == "__main__":
    for line in fileinput.input():
        a = int(line.split(" ")[0])
        b = int(line.split(" ")[1])
        c = int(line.split(" ")[2])
        if (a*a+b*b==c*c or a*a+c*c==b*b or b*b+c*c==a*a) :
            print("YES")
        else :
            print("NO")
    exit(0)

### FIXED CODE ###

# usr/bin/python
# coding: utf-8
################################################################################
# Is it a Right Triangle?
# Write a program which judges wheather given length of three side form a right triangle.
# Print "YES" if the given sides (integers) form a right triangle, "NO" if not so.
#
# Input
# Input consists of several data sets. In the first line, the number of data set,
# N is given. Then, N lines follow, each line corresponds to a data set.
# A data set consists of three integers separated by a single space.
#
# Constraints
# 1 ??? length of the side ??? 1,000
# N ??? 1,000
# Output
# For each data set, print "YES" or "NO".
#
# Sample Input
# 3
# 4 3 5
# 4 3 6
# 8 8 8
# Output for the Sample Input
# YES
# NO
# NO
#
################################################################################

if __name__ == "__main__":
    num = int(input())
    inputline = [""]*num
    for i in range(0,num):
        inputline[i] = input()
    for line in inputline:
        a = int(line.split(" ")[0])
        b = int(line.split(" ")[1])
        c = int(line.split(" ")[2])
        if (a*a+b*b == c*c or b*b+c*c == a*a or c*c+a*a == b*b):
            print("YES")
        else:
            print("NO")
if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 == 0:
            if i % 3 == 0 or i % 5 == 0:
                ret = "APPROVED"
            else:
                ret  = "DENIED"
                break
        else:
            continue
    print(ret)


### FIXED CODE ###



if __name__ == "__main__":
    N = int(input())
    A = map(int, input().split())
    for i in A:
        if i % 2 ==0:
            if i % 3 != 0 and i % 5 != 0:
                    print("DENIED")
                    exit(0)
            else:
                pass
        else:
            pass
    print("APPROVED")
S = list(input())
 
s = sorted(s)
 
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = list(input())
 
S = sorted(S)
 
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
    print('Yes')
else:
    print('No')
# ==================================================-
# 二分探索
# functionを満たす,search_listの最大の要素を出力
# 【注意点】searchリストの初めの方はfunctionを満たし、後ろに行くにつれて満たさなくなるべき
import math
import sys
sys.setrecursionlimit(10**9)

def binary_research(start,end,search_list,function):
    if start==end:
        return search_list[start]
    middle=math.ceil((start+end)/2)
    if function(search_list[middle],k,a_sum,b_sum):
        start=middle
    else:
        end=middle-1
    return binary_research(start, end, search_list, function)

# ==================================================-

n,m,k=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
a_sum=[0]
b_sum=[0]
for book in a:
    a_sum.append(a_sum[-1]+book)
for book in b:
    b_sum.append(b_sum[-1]+book)


def can_read(num,k,a_sum,b_sum):

    min_read_time=1000000000000000
    for i in range(max(0,num-m),n+1):
        a_num=i
        b_num=num-i
        min_read_time=min(min_read_time,a_sum[a_num]+b_sum[b_num])
    if min_read_time<=k:
        return True
    return False

search_list=list(range(n+m+1))
start=0
end=n+m

print(binary_research(start,end,search_list,can_read))


### FIXED CODE ###

n,m,k=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

def make_sumlist(book_list):
    sumnum=0
    container=[0]
    for i in book_list:
        container.append(sumnum+i)
        sumnum+=i
    return container

total_a=make_sumlist(a)
total_b=make_sumlist(b)

# print(n,m,k)
# print(total_a)
# print(total_b)


#r個読めるか
def readable(r):
    #全部読んでも無理
    if r>n+m:
        return False
    if r==0:
        return True
    max_book=100000000000
    for a_n in range(max(0,r-m),min(n,r)+1):
        b_n=r-a_n
        # print(a_n,b_n)
        book_sum=total_a[a_n]+total_b[b_n]
        # print(book_sum)
        max_book=min(max_book,book_sum)
    if max_book<=k:
        return True
    return False

def nibuntansaku(start,end):
    if start==end:
        return start
    middle=(start+end)//2+1
    if readable(middle):
        start=middle
    else:
        end=middle-1
    return nibuntansaku(start,end)

print(nibuntansaku(0,k))
# -*- coding: utf-8 -*-

def main():

    X, N = map(int, input().split())
    p = list(map(int, input().split()))

    listNotP = []

    if N == 0:
        ans = 0

    for i in range(0, 101):
        if i not in p:
            listNotP.append(i)

    listNotP.sort()

    for i in range(len(listNotP) - 1):
        if abs(listNotP[i] - X) < abs(listNotP[i + 1] - X):
            ans = listNotP[i]
            break

        elif abs(listNotP[i] - X) == abs(listNotP[i + 1] - X):
            ans = listNotP[i]
            break

    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

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

def main():

    X, N = map(int, input().split())
    p = list(map(int, input().split()))

    for i in range(101):
        if (X - i) not in p:
            ans = X - i
            break

        elif (X + i) not in p:
            ans = X + i
            break

    print(ans)


if __name__ == "__main__":
    main()
N=int(input())
l=[int(i) for i in input().split()]
l.sort()
print(max(0,l[int(N/2)] - l[int(N/2)-1])


### FIXED CODE ###

N=int(input())
l=[int(i) for i in input().split()]
l.sort()
print(max(0,l[int(N/2)] - l[int(N/2)-1]))
N = int(input())
S = input()

ans = S.count('R') * S.count('G') * S.count('B')
for i in range(N):
  a = S[i]
  for j in range(i+1,N):
    b = S[j]
    if (i+j)%2 :
      continue
    k = (i+j)//2
    if [a,S[k],b].sort() == ['B','G','R']
      ans -= 1
      
print(ans)

### FIXED CODE ###

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

ans = S.count('R') * S.count('G') * S.count('B')
for i in range(N):
  for j in range(i+1,N):
    if (i+j)%2 :
      continue
    k = (i+j)//2
    if len(set([S[i],S[k],S[j]])) == 3:
      ans -= 1
      
print(ans)
s, t = input().split()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
t = input()
s = list(s)
s.sort()
t = list(t)
t.sort(reverse = True)
if t>s:
    print('Yes')
else:
    print('No')
n = int(input())
h = list(map(int, input().split()))

def dp(i):

    if i == 0:
        return 0
    elif i == 1:
        return abs(h[1] - h[0])
    elif 2 <= i:
        return min(dp(i-1) + abs(h[i]-h[i-1]), dp(i-2) + abs(h[i] - h[i-2]))
    else:
        return 100000000

print(dp(n-1))


### FIXED CODE ###

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

dp = [100000] * n

dp[0] = 0

for i in range(0, n):
    if i == 0:
        dp[i] = 0
    elif i == 1:
        dp[i] = abs(h[i-1] - h[i])
    else:
        a = dp[i-1] + abs(h[i] - h[i-1])
        b = dp[i-2] + abs(h[i] - h[i-2])
        dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]))

print(dp[-1])
dire = [0,0,0,0]
d = {c:i for i,c in numerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')

### FIXED CODE ###

dire = [0,0,0,0]
d = {c:i for i,c in enumerate('WENS')}
for c in input():
	dire[d[c]] = 1
print('No' if (dire[0] ^ dire[1]) or (dire[2] ^ dire[3]) else 'Yes')
#coding:UTF-8
s = input().split()
cir = 2*(int(s[0])+int(s[1]))
area = int(s[0])*int(s[1])
print (area,cir)

### FIXED CODE ###

#coding:UTF-8
s = input().split()
cir = 2*(int(s[0])+int(s[1]))
area = int(s[0])*int(s[1])
print (area,cir)
from math import log2
a, b = map(int, input().split())
p, q = a, b
a -= 1
if a > 0:
    n = int(log2(a))
else:
    n = -1
m = int(log2(b))
a_cnt = [0]*(m+1)
b_cnt = [0]*(m+1)
for i in range(m, 0, -1):
    if i <= n:
        if a >= 2**i:
            a_cnt[i] = a-2**i+1
            a -= 2**i
    if b >= 2**i:
        b_cnt[i] = b-2**i+1
        b -= 2**i

ans = [0]*(m+1)
for i in range(m+1):
    ans[i] = (b_cnt[i]-a_cnt[i])%2

tmp = 0
for i in range(1, m+1):
    if ans[i]:
        tmp += 2**i

tmp += ((q+1)//2-p//2)%2
print(tmp)


### FIXED CODE ###

from math import log2
a, b = map(int, input().split())
p, q = a, b
a -= 1
if a > 0:
    n = int(log2(a))
else:
    n = -1
if b > 0:
    m = int(log2(b))
else:
    print(0)
    exit()
a_cnt = [0]*(m+1)
b_cnt = [0]*(m+1)
for i in range(m, 0, -1):
    if i <= n:
        if a >= 2**i:
            a_cnt[i] = a-2**i+1
            a -= 2**i
    if b >= 2**i:
        b_cnt[i] = b-2**i+1
        b -= 2**i

ans = [0]*(m+1)
for i in range(m+1):
    ans[i] = (b_cnt[i]-a_cnt[i])%2

tmp = 0
for i in range(1, m+1):
    if ans[i]:
        tmp += 2**i

tmp += ((q+1)//2-p//2)%2
print(tmp)
a, b = input().split()
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')


### FIXED CODE ###

a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
N, A, B = map(int, input().split())

b = '1'
r = '0'

x =[]
cnt = 0
while len(x) < N:
  x.append(A*b)
  x.append(B*r)

for i in range(x):
  tmp = 0
  tmp = int(i)
  cnt += i

pint(cnt)

### FIXED CODE ###

N, A, B = map(int,input().split())
 
x = A * (N // (A+B))
 
y = N % (A+B)
 
ans = x + min(A, y)
 
print(ans)
n,k=map(int,input().split())
h=list(map(int,input().split()))+[0]*(k+10)
dp=[(float("inf")) for i in range(n+k+10)]
dp[0]=0
def main():
  	for i in range(n-1):
      	for j in range(k):
          	dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  	print(dp[n-1])
main()


### FIXED CODE ###

def main():
  n,k=map(int,input().split())
  h=list(map(int,input().split()))+[0]*(k+10)
  dp=[(float("inf")) for i in range(n+k+10)]
  dp[0]=0
  for i in range(n-1):
    for j in range(k):
      dp[i+j+1]=min(dp[i]+abs(h[i]-h[i+j+1]),dp[i+j+1])
  return (dp[n-1])
print(main())
n,k = map(int,input().split())
H = [int(input()) for _ in range(n)]
H.sort()
ans = float('inf')

for i in range(n-k+1):
  ans = min(H[i+k-1]-H[i])
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
H = [int(input()) for _ in range(n)]
H.sort()
ans = float('inf')

for i in range(n-k+1):
  ans = min(H[i+k-1]-H[i], ans)
print(ans)
def f(n):
  return '7' in n
 
print 'Yes' if f(raw_input()) else 'No'

### FIXED CODE ###

def f(n):
  return '7' in n
 
print 'Yes' if f(raw_input()) else 'No'
import sys
import math
import bisect
import heapq
import copy
from fractions import gcd
from itertools import permutations, combinations,combinations_with_replacement,product
from collections import defaultdict, Counter, deque

N = int(input())
T, A = [0]*N, [0]*N
for i in range(N):
    T[i], A[i] = map(int, input().split())
a, b = 1, 1
else:
    for x, y in zip(T, A):
        if a>x or b>y:
            c = max(math.ceil(a/x), math.ceil(b/y))
            a, b = x*c, y*c
        else:
            a, b = x, y
    print(a+b)

### FIXED CODE ###

import sys
import math
import bisect
import heapq
import copy
from fractions import gcd
from itertools import permutations, combinations,combinations_with_replacement,product
from collections import defaultdict, Counter, deque

N = int(input())
T, A = [0]*N, [0]*N
for i in range(N):
    T[i], A[i] = map(int, input().split())
a, b = T[0], A[0]
if N == 1:
    print(a+b)
else:
    for x, y in zip(T[1:], A[1:]):
        c = max((a-1)//x+1, (b-1)//y+1)
        a, b = x*c, y*c
    print(a+b)
n = int(input())
a = input().split( )

b = []
j = 0
k = 1

for i in range(n):
	if k == int(a[i]):
	b.append(int(a[i]))
	j += 1
	k += 1

if 0 == len(b):
	print(-1)
else:
	print(int(n)-len(b))


### FIXED CODE ###

n = int(input())
a = input().split( )

b = []
j = 0
k = 1

for i in range(n):
  if k == int(a[i]):
    b.append(int(a[i]))
    j += 1
    k += 1

if 0 == len(b):
  print(-1)
else:
  print(int(n)-len(b))
# coding: utf-8

import sys
def input(): return sys.stdin.readline().strip()

N = int(input())
# L = [int(x) for x in input().split()]
# N, M = map(int, input().split())
# S = input()

ball = [[int(x) for x in input().split()] for _ in range(N)]
dist = {}

for i, a in enumerate(ball):
    x0 = a[0]
    y0 = a[1]

    for j, b in enumerate(ball):
        x1 = b[0]
        y1 = b[1]

        xy = (x1-x0, y1-y0)

        if xy == (0, 0):
            continue

        if not xy in dist:
            dist[xy] = 1
        else:
            dist[xy] += 1
            
print(N - max(dist.values()))


### FIXED CODE ###

# coding: utf-8

import sys
def input(): return sys.stdin.readline().strip()

N = int(input())
# L = [int(x) for x in input().split()]
# N, M = map(int, input().split())
# S = input()

ball = [[int(x) for x in input().split()] for _ in range(N)]
dist = {}

for i, a in enumerate(ball):
    x0 = a[0]
    y0 = a[1]

    for j, b in enumerate(ball):
        x1 = b[0]
        y1 = b[1]

        xy = (x1-x0, y1-y0)

        if xy == (0, 0):
            continue

        if not xy in dist:
            dist[xy] = 1
        else:
            dist[xy] += 1

try:
    num = max(dist.values())
except:
    num = 0

print(N - num)
S = input()
S.sorted()
if S = "abc":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = sorted(input())
if S == sorted('abc'):
    print('Yes')
else:
    print('No')
x = int(input().split())
if x[0]<x[2]<x[1]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

x = list(map(int, input().split()))
if x[0]<x[2]<x[1]:
    print("Yes")
elif x[1]<x[2]<x[0]:
    print("Yes")
else:
    print("No")
x = input()
k = input()

X = int(x)
K = int(k)

if X <= K*500:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

k, x = input().split()

if int(x) <= int(k)*500:
    print("Yes")
else:
    print("No")
N = int(input())
T = list(map(int, input().split()))
M = int(input())

s = sum(T)
for i in range(N):
  P, X = map(int, input().split())
  print(s - T[P-1] + X)

### FIXED CODE ###

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

s = sum(T)
for i in range(M):
  P, X = map(int, input().split())
  print(s - T[P-1] + X)
S = input()

keyence_str = "keyence"

def is_keyence(S):
    i = 0
    is_change = False
    change_num = 0
    for j in range(len(S)):
        print(i, j, S[j],keyence_str[i])
        if S[j] != keyence_str[i]:
            if is_change: change_num += 1
            else:
                if change_num > 0:
                    # 二回以上修正箇所がある
                    return False
                is_change = True
                change_num += 1
        else:
            if is_change: is_change = False
            i += 1
    if i == len(keyence_str):
        return True
    else: return False


if is_keyence(S):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

S = input()

def is_keyence(S):
    key = "keyence"
    for i in range(len(key)):
        #print(key[:i], key[i:])
        if (S.startswith(key[:i]) and S.endswith(key[i:])):
            return True
    return False


if is_keyence(S):
    print("YES")
else:
    print("NO")
N,R = map(int,input().split)
if N < 10:
  R = R - 100 * (10 - N)
  print(R)
else:
  print(R)

### FIXED CODE ###

N,R = map(int,input().split())
if N < 10:
  R = R + 100 * (10 - N)
  print(R)
else:
  print(R)
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    if i >= k:
        ans += 1/n
    else:
        if k//i == 0 :
            num = 1
        else:
            num = int((np.log2(k/i)+1)//1)
        ans += (1/n)*(1/2)**num
    
print(ans)

### FIXED CODE ###

import numpy as np
import math 
n,k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    if i >= k:
        ans += 1/n
    else:
        num = math.ceil(np.log2(k/i))
        ans += (1/n)*(1/2)**num
    
print(ans)