Harryxun/stf_run huggingface dataset:
import sys
input=lambda: sys.stdin.readline().rstrip()
n,q=map(int,input().split())
C=[int(i) for i in input().split()]
LR=[]
for i in range(q):
    l,r=map(int,input().split())
    LR.append((i,l,r))
LR.sort(key=lambda x:x[2])


LST=[0]*n
Ans=[0]*q

n_max=5*10**5
nn=n_max.bit_length()+1
BIT=[0]*(2**nn)
BIT.insert(0,0)

def bitsum(BIT,i):
  s=0
  while i>0:
    s+=BIT[i]
    i-=i&(-i)
  return s

def bitadd(BIT,i,x):
  while i<=2**nn:
    BIT[i]+=x
    i+=i&(-i)
  return BIT
cur=0
for i,l,r in LR:
    while cur<r:
        if LST[C[cur]]!=0:
            bitadd(BIT,LST[C[cur]],-1)
        LST[C[cur]]=cur+1
        bitadd(BIT,LST[C[cur]],1)
        cur+=1
    if l==1:
        Ans[i]=bitsum(BIT,r+1)
    else:
        Ans[i]=bitsum(BIT,r+1)-bitsum(BIT,l-1)
for ans in Ans:
    print(ans)

### FIXED CODE ###

import sys
input=lambda: sys.stdin.readline().rstrip()
n,q=map(int,input().split())
C=[int(i) for i in input().split()]
LR=[]
for i in range(q):
    l,r=map(int,input().split())
    LR.append((i,l,r))
LR.sort(key=lambda x:x[2])


LST=[0]*(n+1)
Ans=[0]*q

n_max=5*10**5+1
nn=n_max.bit_length()+1
BIT=[0]*(2**nn)
BIT.insert(0,0)

def bitsum(BIT,i):
  s=0
  while i>0:
    s+=BIT[i]
    i-=i&(-i)
  return s

def bitadd(BIT,i,x):
  while i<=2**nn:
    BIT[i]+=x
    i+=i&(-i)
  return BIT
cur=0
for i,l,r in LR:
    while cur<r:
        if LST[C[cur]]!=0:
            bitadd(BIT,LST[C[cur]],-1)
        LST[C[cur]]=cur+1
        bitadd(BIT,LST[C[cur]],1)
        cur+=1
    if l==1:
        Ans[i]=bitsum(BIT,r+1)
    else:
        Ans[i]=bitsum(BIT,r+1)-bitsum(BIT,l-1)
for ans in Ans:
    print(ans)
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a += (int(m) for m in input().split())

print(n - len(a))


### FIXED CODE ###

n, k = map(int, input().split())
a = []

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split()]

print(n - len(set(a)))
# -*- coding: utf-8 -*-

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

BN = [0] * (N//2+1)

# 偶奇で分けて集計
for i in range(N):
    if N % 2 != 0:
        BN[N//2 - AN[i]//2] += 1
    else:
        BN[N//2 - (AN[i]-1)//2] += 1

# 偶数の場合は真ん中を考慮
ans = 0
for i in range(len(BN)):
    if BN[i] > 2 or N % 2 != 0 and BN[-1] > 1:
        print(0)
        exit()

# 結果出力
print(2 ** (N//2))

### FIXED CODE ###

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

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

BN = [0] * (N//2+1)

# 偶奇で分けて集計
for i in range(N):
    if N % 2 != 0:
        BN[N//2 - AN[i]//2] += 1
    else:
        BN[N//2 - (AN[i]//2+1)] += 1

# 偶数の場合は真ん中を考慮
ans = 0
for i in range(len(BN)):
    if BN[i] > 2 or N % 2 != 0 and BN[-1] > 1:
        print(0)
        exit()

# 結果出力
print(2 ** (N//2) % (10 ** 9 +7))
#coding: UTF-8

x = input()

i = 1

while x !=0:
    print('Case '+i+': '+x)
    i +=1



### FIXED CODE ###

c = 0

while True:
    x = int(input())
    c +=1
    
    if x == 0:
        break
   
    print("Case {}: {}".format(c, x))
def looptime(n, a):
    for i in range(n):
        loop = 0
        start = i
        now = i

        time = 0

        while(loop < n):
            now = a[now]
            loop += 1
            now -= 1

            if now == start:
                return i+1, loop

def start_loop(goal, a):
    loop = 0
    now = 0

    time = 0

    while(loop < n):
        now = a[now]
        loop += 1
        now -= 1

        if now == goal-1:
            return loop

if __name__ == '__main__':

    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    start, loop = looptime(n, a)
    how = start_loop(start, a)
    point = k%loop

    #print(start, loop, point, how)

    if how == loop:
        # startからループ開始
        time = 0
        now = 0
        while(time < point):
            now = a[now]
            now -= 1
            time += 1
        print(now+1)

    else:
        # 途中からループ開始
        if how > k:
            time = 0
            now = 0
            while(time < k):
                now = a[now]
                now -= 1
                time += 1
            print(now+1)

        else:
            time = 0
            now = start-1
            point = (point+how)%loop
            while(time < point-1):
                now = a[now]
                now -= 1
                time += 1
            print(now+1)


### FIXED CODE ###

if __name__ == '__main__':

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

    root = [] # 訪れた頂点をメモ
    already = [-1] * (n+1) # rootのindexのメモ　と　すでに訪れたか

    c = 1# 周期
    l = 0# 例外部分のながさ

    v = 1#頂点は1 ここから遷移
    while(already[v] == -1): # すでに書いてあれば訪れている。かつ周期の起点となる場所
        already[v] = len(root) #訪れたら何回目かを記述
        root.append(v)
        v = a[v-1]

    c = len(root) - already[v]
    l = already[v]

    if k < l:#例外部分のながさ
        ans = root[k]
    else:# 周期にいるなら
        k -= l
        ans = root[k%c+l]

    print(ans)
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
Ad.sort()
l = len(Ad)
if l % 2 == 1:
    b = Ad[l//2]
    ans = sum(map(lambda x:abs(x-b), Ad))
else:
    b1, b2 = Ad[l//2], Ad[l//2-1]
    ans = min(sum(map(lambda x:abs(x-b1), Ad)), sum(map(lambda x:abs(x-b2), Ad)))
print(ans)
word = input().split()
#print(word)
if word[0] == "7" :
    print("Yes")
elif word[1] == "7" :
    print("Yes")
elif word[2] == "7" :
    print("Yes")
else:
    print("No")


### FIXED CODE ###

num = input()
word = list(num)
#print(word)
if word[0] == "7" :
    print("Yes")
elif word[1] == "7" :
    print("Yes")
elif word[2] == "7" :
    print("Yes")
else:
    print("No")
n = int(input())
t = [int(input()) for i in range(n)]

def gcd(a, b):
  if a<b:
    a, b = b, a
  if b==0:
    return a
  return gcd(b, a%b)

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

ans = 1
for i in range(n):
  ans = lcm(ans, t[i])
print(ans)

### FIXED CODE ###

n = input()
if n[0]==n[2]:
  print("Yes")
else:
  print("No")
import math,fractions
from collections import Counter
n = int(input())
v = [int(i) for i in input().split()]
a = Counter(v[1::2]).most_common()
b = Counter(v[0::2]).most_common()

if a[0][0] != b[0][0]:
    print(n//2 - a[0][1] + n//2 - b[0][1])
else:
    tmp_x = n//2 - a[1][1] + n//2 - b[0][1]
    tmp_y = n//2 - a[0][1] + n//2 - b[1][1]
    print(min(tmp_x, tmp_y))


### FIXED CODE ###

import math,fractions
from collections import Counter
n = int(input())
v = [int(i) for i in input().split()]
a = [v[i] for i in range(n) if i%2]
b = [v[i] for i in range(n) if i%2==0]
cnt_a = Counter(a)
cnt_b = Counter(b)
max_a = cnt_a.most_common()[0][1]
max_b = cnt_b.most_common()[0][1]

str_a = cnt_a.most_common()[0][0]
str_b = cnt_b.most_common()[0][0]

max_2a = 0
max_2b = 0

for i in cnt_a:
    if str_a != i  and cnt_a[i] > max_2a:
        max_2a = cnt_a[i]

for i in cnt_b:
    if str_b != i  and cnt_b[i] > max_2b:
        max_2b = cnt_b[i]

if str_a != str_b:
    print(n//2 - max_a + n//2 - max_b)
else:
    tmp_a = n//2 - max_2a + n//2 - max_b
    tmp_b = n//2 - max_a + n//2 - max_2b
    print(min(tmp_a,tmp_b))
def s(way):
    global w
    w2 =[]
    for i in way:

        for j in w[i]:
            if c[j] == 0:

                w2.append(i)
        c[i] = 1
        if not w2 ==[]:
            s(w2)


n,m = map(int,input().split())
a = [0 for i in range(m)]
b = [0 for i in range(m)]
w = [[] for i in range(n)]
c = [0 for i in range(n)]
for i in range(m):
    a[i],b[i] = map(int,input().split())
    w[a[i]-1].append(b[i]-1)
    w[b[i]-1].append(a[i]-1)
ans =-1
for i in range(n):
    if c[i] == 0:
        c[i] = 1
        ans += 1
        s(w[i])

print(ans)

### FIXED CODE ###


from collections import deque

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

w = [[] for i in range(n)]
c = [0 for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    w[a-1].append(b-1)
    w[b-1].append(a-1)
ans =-1
for i in range(n):
    if c[i] == 0:
        c[i] = 1
        ans += 1
        d.append(i)
        while d:
            x = d.pop()
            for i in w[x]:
                if c[i] == 0:
                    c[i] = 1
                    d.append(i)

print(ans)
K = int(input())
maxnum = 10**20
al = []

def sunuke(i):
    s = 0
    old = i
    while i>0:
        s += i%10
        i = i//10
    return [old/s,old]

for i in range(1,100):
    al.append(sunuke(i))
for j in range(3,16):
    for k in range(10,100):
        al.append(sunuke(k*(10**(j-2))+10**(j-2)-1))
anslist = []
al.reverse()
for j in al:
    if j[0]<=maxnum:
        anslist.append(j[1])
        maxnum = j[0]
anslist.reverse()

for i in range(K):
    print(anslist[i])

### FIXED CODE ###

K = int(input())
al = []

def sums(i):
    s = 0
    old = i
    while i>0:
        s += i%10
        i = i//10
    return (s,old)

for i in range(1,1000):
    al.append(sums(i))
for j in range(4,16):
    for k in range(100,1000):
        al.append(sums(k*(10**(j-3))+10**(j-3)-1))
anslist = []
al.reverse()
maxs,maxi = sums(10**15)
for j in al:
    if maxs*j[1] <= maxi*j[0]:
        anslist.append(j[1])
        maxs = j[0]
        maxi = j[1]
anslist.reverse()

for i in range(K):
    print(anslist[i])
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N = int(input())
    S = input()
    cnt0 = S.count("1")

    if cnt0 == 0:
        print("\n".join(map(str, [1]*N)))
        raise 1
        return

    X = int(S, 2)

    def f2():
        cache = [0] * (cnt0 + 1)
        i = 1
        bi = []
        while i <= cnt0:
            bi.append(i)
            i <<= 1
        from collections import deque
        dq = deque([(0, 0, 0)])
        ls = len(bi)
        while dq:
            i, x, cnt = dq.popleft()

            cnt += 1
            for j in range(i, ls):
                y = x | bi[j]

                if y > cnt0: break

                cache[y] = cache[y % cnt] + 1

                j += 1
                if j < ls:
                    dq.append((j, y, cnt))
        return cache


    memo = f2()

    dc = []
    for v in [1, -1]:
        x = cnt0 + v
        y = X % x if x else 0
        dc.append((x, v, y, [1, N-1]))

    ans = [0] * N
    for i in reversed(range(N)):
        cnt, v, n, m1 = dc[0 if S[i] == "0" else 1]

        if cnt == 0:
            ans[i] = 0
            continue

        m2 = (m1[0]<<(m1[1]-i)) % cnt
        n = (n + v*m2) % cnt
        m1[0], m1[1] =  m2, i

        ans[i] = 1 + memo[n]

    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
from functools import lru_cache


@lru_cache(maxsize=2*10**5)
def f2(x):
    if x == 0: return 0
    y = bin(x).count("1")
    return 1 + f2(x % y)

def resolve():
    N = int(input())
    W = 16
    S = input()
    cnt0 = S.count("1")

    if cnt0 == 0:
        print(*[1]*N, sep="\n")
        return

    X = int(S, 2)

    dc = {}
    for k, v in (("0", 1), ("1", -1)):
        x = cnt0 + v
        y = X % x if x else 0
        dc[k] = (x, v, y)

    ans = []
    for i, si in enumerate(S):
        cnt, v, n = dc[si]

        if cnt == 0:
            ans.append(0)
            continue

        ni = N - i - 1
        n = (n + v * pow(2, ni, cnt)) % cnt

        ans.append(1+f2(n))

    print(*ans, sep="\n")


if __name__ == "__main__":
    resolve()
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcb(b, a%b)
N = int(input())
A = map(int,input().split())
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)

### FIXED CODE ###

def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    return gcd(b, a%b)
N = int(input())
a = list(map(int,input().split()))
g1=[0 for i in range(N)]
g2=[0 for i in range(N)]
g1[0]=a[0]
g2[N-1]=a[N-1]
for i in range(1,N):
  g1[i]=gcd(g1[i-1],a[i])
for i in range(N-2,-1,-1):
  g2[i]=gcd(g2[i+1],a[i])
ans=1
for i in range(N-2):
  a=gcd(g1[i],g2[i+2])
  ans=max(ans,a)
ans=max(ans,g1[N-2],g2[1])
print(ans)
a,b,c,d=map(int,input().split)

while True:
  a-=d
  if a<=0:
    print("No")
    break
  c-=b
  if c=<0:
    print("Yes")
    break

### FIXED CODE ###

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

while True:
  C-=B
  if C<=0:
    print("Yes")
    break
  A-=D
  if A<=0:
    print("No")
    break
S = input()
T = input()

if S == T[:-1]
     print("YES")
  else
  print("NO")

### FIXED CODE ###


    
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")
a, b = input()

if a == b:
  print('H')
else:
  print('D')

### FIXED CODE ###

a, b = input().split()

if a == b:
  print('H')
else:
  print('D')
import math
n = int(input())
l = list(map(int, input().split()))
ans = l[0]
for i in range(1, n):
    ans = ans * l[i] // math.gcd(ans, l[i])
print(ans - 1)

### FIXED CODE ###

import fractions
n = int(input())
l = list(map(int, input().split()))
m = l[0]
for i in range(1, n):
    m = m * l[i] // fractions.gcd(m, l[i])
m = m - 1
ans = 0
for i in l:
    ans += m % i
print(ans)
import math
a,b,n = map(int,input().split())
if b != 1:
    x = min(n, b-1)
    while x <= n:
        Max = max(math.floor(a*x/b) - a*math.floor(x/b),Max)
        x += b
else:
    Max = 0
print(Max)

### FIXED CODE ###

import math
a,b,n = map(int,input().split())
Max = 0
if b != 1:
    x = min(n, b-1)
    while x <= n:
        Max = max(math.floor(a*x/b) - a * math.floor(x/b),Max)
        x += b
else:
    Max = 0
print(Max)
a, b, c = map(int, input().split())
min = min{a + b, b + c, c + a}
print(min)

### FIXED CODE ###

a, b, c = map(int, input().split())
min = min(a + b, b + c, c + a)
print(min)
S = input()
x = len(S)
y = 15 - x
z = ""
point = 0
for i in range(x + 1):
  z = S[i]
  if (z == "o"):
    point += 1
  else:
    
if (point + y >= 8):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

S = input()
x = len(S)
y = 15 - x
z = ""
point = 0
for i in range(x):
  z = S[i]
  if (z == "o"):
    point += 1
  else:
    point += 0
    
y = y + point
if (y >= 8):
  print("YES")
else:
  print("NO")
n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
    k, z = map(int, input().split())
    kagen.append(k)
    zyogen.append(z)

kk = sorted(kagen)
zz = sorted(zyogen)
if(n % 2 == 0):
    aa = n // 2
    x = kk[aa-1] + kk[a]
    y = zz[aa-1] + zz[a]
    print(y-x+1)
else:
    aa = n // 2
    x = kk[aa]
    y = zz[aa]
    print(y-x+1)
    

### FIXED CODE ###

n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
    k, z = map(int, input().split())
    kagen.append(k)
    zyogen.append(z)

kk = sorted(kagen)
zz = sorted(zyogen)
if(n % 2 == 0):
    aa = n // 2
    x = kk[aa-1] + kk[aa]
    y = zz[aa-1] + zz[aa]
    print(y-x+1)
else:
    aa = n // 2
    x = kk[aa]
    y = zz[aa]
    print(y-x+1)
alpha = input()
if alpha.isupper():
  output = A
else:
  ourput = a

print(output)


### FIXED CODE ###

alpha = input()
if alpha.isupper():
  output = 'A'
else:
  output = 'a'

print(output)
h,w=map(int,input().split())
a=[]
for i in range(h):
  a.append(list("."+(input())+"."))
a.insert(0,["."]*(h+2))
a.append(["."]*(h+2))
flg = True
for i in range(h+2):
  for j in range(w+2):
    if a[i][j] == "#":
      for (k,l) in ((i,j+1),(i,j-1),(i+1,j),(i-1,j)):
        if a[k][l] != "#":
          cnt+=1
          if cnt == 4:
            flg = False
    cnt=0
if flg:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

h,w=map(int,input().split())
a=[]
for i in range(h):
  a.append(list("."+(input())+"."))
a.insert(0,["."]*(w+2))
a.append(["."]*(w+2))
flg = True
for i in range(h+2):
  for j in range(w+2):
    if a[i][j] == "#":
      for (k,l) in ((i,j+1),(i,j-1),(i+1,j),(i-1,j)):
        if a[k][l] != "#":
          cnt+=1
          if cnt == 4:
            flg = False
    cnt=0
if flg:
  print("Yes")
else:
  print("No")
for a in range(n):#10000
    for b in range(n):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")


### FIXED CODE ###

n,y = map(int,input().split())
d = 0

for a in range(n+1):#10000
    for b in range(n+1):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")
#3
#8 12 40
n=int(input())
ai=list(map(int(),input().split()))
b=[]
for a in ai:
  count =0
  while a%2==0 :
    count+=1
    a/=2
  b.append(count)
print(min(b))

### FIXED CODE ###

#3
#8 12 40
n=int(input())
ai=list(map(int,input().split()))
b=[]
for a in ai:
  count =0
  while a%2==0 :
    count+=1
    a/=2
  b.append(count)
print(min(b))
a,b =map(int,input().split())
print(max(a+b,a-b,a*b)

### FIXED CODE ###

a,b =map(int,input().split())
print(max(a+b,a-b,a*b))
a=int(input())
c=list(input())
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=26:
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
print(c)


### FIXED CODE ###

N=int(input())
S=list(input())
a=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
res=''

for s in S:
  code=a.index(s)+N
  if code>a.index('Z'):
    code-=26
  res+=a[code]
print(res)
import sys
 
args = sys.argv
prices = map(int, args[1:])
min = prices[0]

max_profit = 0
for price in prices:
    if min > price:
        min = price
    max_profit = price - min

print(max_profit)


### FIXED CODE ###

n = input()
prices = list()
for idx in range(int(n)):
    tmp = input()
    prices.append(int(tmp))

minp = prices[0]
maxv = prices[1] - prices[0]

for price in prices[1:]:
    maxv = max(maxv, price - minp)
    minp = min(minp, price)

print(maxv)
#A One card Poker
A,B = [int(i) for i in input().split(" ")]
if A == B:
    print("Draw")
elif (A == 1) or (A>B and B!=1):
    print("Alice")
else:
    print("Bob")

### FIXED CODE ###

#A One card Poker
A,B = [int(i) for i in input().split(" ")]
if A == B:
    print("Draw")
elif (A == 1) or (A>B and B!=1):
    print("Alice")
else:
    print("Bob")
k = int(inpout())
s = input()

if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")

### FIXED CODE ###

k = int(input())
s = input()
 
if len(s) <= k :
  print(s)
else:
  print(s[0:k]+"...")
a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
print(a[0].upper+b[0].upper+c[0].upper)

### FIXED CODE ###

a,b,c=input().split()
a=list(a)
b=list(b)
c=list(c)
print(a[0].upper()+b[0].upper()+c[0].upper())
I = list(map(int,input().split()))
N = I[0]
M = I[1]
A = list(map(int,input().split()))

for i in range(M):
    num = index(max(A))
    A[num] = A[num] / 2

B = map(int,A)
ans = sum(B)
print(ans)

### FIXED CODE ###

import heapq
import math
I = list(map(int,input().split()))
N = I[0]
M = I[1]
A = list(map(lambda x:-x,map(int,input().split())))
heapq.heapify(A)
for i in range(M):
    num = heapq.heappop(A)
    num = math.ceil(num / 2)
    heapq.heappush(A,num)

print(-sum(A))
x ,n = map(int, input().split())
s = list(map(int, input().split()))
number = list(range(1,101))
min = 100
if n == 0:
  print(x)
  exit()
  
for i in range(n):
  number.remove(s[i])

for i in range(100 - n):
  if min > abs(x - number[i]):
    min = abs(x - number[i])
    j = i
print(number[j])

### FIXED CODE ###

x ,n = map(int, input().split())
s = list(map(int, input().split()))
number = list(range(0,102))
min = 100
if n == 0:
  print(x)
  exit()
  
for i in range(n):
  number.remove(s[i])

for i in range(102 - n):
  if min > abs(x - number[i]):
    min = abs(x - number[i])
    j = i
print(number[j])
import numpy as np

def resolve():
    n = int(input())
    h = np.array(list(map(int, input().split())))
    k = 2

    dp = np.zeros(n, dtype=int)

    for i in range(1, n):
        start = max(0, i - k)
        dp[i] = min(dp[start:i] + np.abs(h[i] - h[start:i]))

    print(dp[n - 1])
    
resolve()

### FIXED CODE ###

n, k = map(int, input().split())
li = list(map(int, input().split()))

dp = [float('inf')] * n

dp[0] = 0

for i in range(n):
  for j in range(1, k + 1):
    if i + j < n:
      dp[i + j] = min(dp[i + j], dp[i] + abs(li[i] - li[i + j]))

print(dp[n-1])
import numpy as np

def main():
    n = int(input())
    ball = [list(map(int, input().split(' '))) for i in range(n)]
    ball = list(map(list, set(map(tuple, ball))))
    ball = np.array(ball, dtype=int)
    # print(ball)

    l1 = []
    l2 = []
    for i in range(len(ball)):
        for j in range(i, len(ball)):
            if i == j: continue
            dis1 = ball[i] - ball[j]
            dis2 = ball[j] - ball[i]
            l1.append(list(dis1))
            l2.append(list(dis2))
    # print(l1, l2)
    # c1 = collections.Counter(l1)
    # c2 = collections.Counter(l2)

    c1 = []
    c2 = []
    for i in range(len(l1)):
        c1.append(l1.count(l1[i]))
        c2.append(l2.count(l2[i]))
    m1 = np.max(np.array(c1, dtype=int))
    m2 = np.max(np.array(c2, dtype=int))

    print(max(1,n-max(m1,m2)))

if __name__ == "__main__":
    main()

### FIXED CODE ###

import numpy as np

def main():
    n = int(input())
    ball = [list(map(int, input().split(' '))) for i in range(n)]
    ball = np.array(ball, dtype=int)
    if n == 1:
        print(1)
        exit()

    l1 = []
    for i in range(len(ball)):
        for j in range(len(ball)):
            if i == j: continue
            dis1 = ball[i] - ball[j]
            l1.append(list(dis1))

    c1 = []
    for i in range(len(l1)):
        c1.append(l1.count(l1[i]))
    m1 = np.max(np.array(c1, dtype=int))

    print(n-m1)

if __name__ == "__main__":
    main()
def main():
  a, b = map(str, input().split())
  print(round(int(a)*floar(b)))

main()

### FIXED CODE ###

a, b = map(str, input().split())
a = int(a)
b1, b2 = b.split('.')
b = int(b1) * 100 + int(b2)
ans = a * b
print(ans//100)
l=0
for i range (2):
  l=l+int(input())
print(6-l)

### FIXED CODE ###

a=0
for i in range(2):
  a=a+int(input())
print(int(6-a))
X=input()
t=input()
if t>X:
  print "0" 
else:
  print X-t

### FIXED CODE ###

X,t=map(int,raw_input().split())
if t>=X:
  print "0" 
else:
  print X-t
def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>=max_value:
                    max_value=c
                if sum_value>S:　
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))



### FIXED CODE ###

def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>max_value:#最初は>=にしてたのですが、> にすることで高速化を図れました
                    max_value=c
                if sum_value>S: #bが増加すれば必ずSが増加することを使っていて、なるほどと思いました。
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))
#runtime errorになりましたが、ジャッジングデータと結果が一致しました。制限時間内に解く方法がわかりませんでした。
#右・中央の座席