Harryxun/stf_run huggingface dataset:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import itertools

n = int(input())
p = tuple(map(int,readline().split()))
q = tuple(map(int,readline().split()))

a = 0

permutations = list(itertools.permutations(range(1, n+1)))
p = permutations.index(p)
q = permutations.index(q)

print(abs(p-q))

### FIXED CODE ###

import math

n = int(input())
p = [int(i) for i in input().split()]
q = [int(i) for i in input().split()]

a = 0

for i in range(n):
    tmp = 0
    for j in range(n-i-1):
        if p[i] > p[i+j+1]:
            tmp += 1
    a += tmp*math.factorial(n-1-i)


b = 0

for i in range(n):
    tmp = 0
    for j in range(n-i-1):
        if q[i] > q[i+j+1]:
            tmp += 1
    b += tmp*math.factorial(n-1-i)
    
print(abs(a-b))
l = list(map(int, input().split()))

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 < N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 < n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(" ".join(ans))


### FIXED CODE ###

l = list(map(int, input().split()))

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 <= N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 <= n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(ans[0],ans[1],ans[2])
n = input()
keta = len(n)
n = int(input())

if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(n - 90 + 9)
elif keta == 4:
    print(909)
elif keta == 5:
    print(n - 9000 + 900 - 90 + 9)
else:
    print(90909)

### FIXED CODE ###

n = input()
keta = len(n)
n = int(n)

if keta == 1:
    print(n)
elif keta == 2:
    print(9)
elif keta == 3:
    print(n - 90)
elif keta == 4:
    print(909)
elif keta == 5:
    print(n - 9000  - 90 )
else:
    print(90909)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

def dbg(*args):
    print("DBG: ", file=sys.stderr, end="")
    print(*args, file=sys.stderr)

Mat = collections.namedtuple("Mat", "r c")

def mat_mul(ms):
    return Mat(ms[0].r, ms[-1].c)

def cost(m1, m2):
    return m1.r * m1.c * m2.c

def solve(n, ms):
    if n == 1: return 0

    dp = {}
    for i in range(n):
        dp[(i,i)] = 0

    for l in range(2, n+1):
        for i in range(n-l+1):
            cost_min = math.inf
            #cost_min = float("inf")
            for j in range(l-1):
                dbg("l, i, j: %d %d %d", l, i, j)
                m_lhs = mat_mul(ms[i:i+j+1])
                m_rhs = mat_mul(ms[i+j+1:i+l])
                #dbg("m_lhs, m_rhs: %r %r", m_lhs, m_rhs)
                cost_lhs = dp[(i,i+j)]
                cost_rhs = dp[(i+j+1,i+l-1)]
                #dbg("cost_lhs, cost_rhs: %d %d", cost_lhs, cost_rhs)
                cost_mul = cost(m_lhs, m_rhs)
                #dbg("cost_mul: %d", cost_mul)
                cost_now = cost_mul + cost_lhs + cost_rhs
                #dbg("cost_now: %d", cost_now)
                if cost_min > cost_now:
                    cost_min = cost_now
            dp[(i,i+l-1)] = cost_min

    #dbg(dp)
    return dp[(0,n-1)]

def main():
    n = int(input())

    ms = []
    for _ in range(n):
        r,c = map(int, input().split())
        ms.append(Mat(r,c))

    print(solve(n, ms))

if __name__ == "__main__": main()

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)

Mat = collections.namedtuple("Mat", "r c")

def mat_mul(ms):
    return Mat(ms[0].r, ms[-1].c)

def cost(m1, m2):
    return m1.r * m1.c * m2.c

def solve(n, ms):
    if n == 1: return 0

    dp = {}
    for i in range(n):
        dp[(i,i)] = 0

    for l in range(2, n+1):
        for i in range(n-l+1):
            #cost_min = math.inf
            cost_min = float("inf")
            for j in range(l-1):
                dbg("l, i, j: %d %d %d", l, i, j)
                m_lhs = mat_mul(ms[i:i+j+1])
                m_rhs = mat_mul(ms[i+j+1:i+l])
                dbg("m_lhs, m_rhs: %r %r", m_lhs, m_rhs)
                cost_lhs = dp[(i,i+j)]
                cost_rhs = dp[(i+j+1,i+l-1)]
                dbg("cost_lhs, cost_rhs: %d %d", cost_lhs, cost_rhs)
                cost_mul = cost(m_lhs, m_rhs)
                dbg("cost_mul: %d", cost_mul)
                cost_now = cost_mul + cost_lhs + cost_rhs
                dbg("cost_now: %d", cost_now)
                if cost_min > cost_now:
                    cost_min = cost_now
            dp[(i,i+l-1)] = cost_min

    dbg(dp)
    return dp[(0,n-1)]

def main():
    n = int(input())

    ms = []
    for _ in range(n):
        r,c = map(int, input().split())
        ms.append(Mat(r,c))

    print(solve(n, ms))

if __name__ == "__main__": main()
n, k = map(int, input().split())

mod = 10**9 + 7

p = [1] * (k - 1)  # {k-2}_P_{i} for i=0,1,...,k-2
for i in range(1, k - 1):
    p[i] = (p[i - 1] * (k - 1 - i)) % mod

# tree = [[-1, []] for _ in range(n + 1)]

# for _ in range(n - 1):
#     a, b = map(int, input().split())
#     if a > b:
#         a, b = b, a

#     tree[b][0] = a
#     tree[a][1].append(b)

g = [[] for _ in range(n + 1)]

for _ in range(n - 1):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)

used = [False] * (n + 1)


def dfs(t):
    if t == 1:
        used[0], used[1] = True, True
        num_children = len(g[1])
        if num_children + 1 > k:
            return 0
        else:
            ret = k * (k - 1) * p[num_children - 1]
            for c in g[t]:
                used[c] = True
                ret = (ret * dfs(c)) % mod
            return ret
    else:
        children = []
        for u in g[t]:
            if not used[u]:
                children.append(u)
                used[u] = True
        num_children = len(children)
        if num_children + 2 > k:
            return 0
        else:
            ret = p[num_children]
            for c in children:
                ret = (ret * dfs(c)) % mod

            return ret


print(dfs(1))


### FIXED CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

sys.setrecursionlimit(100005)

n, k = na()
g = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b = na()
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)

mod = 10**9 + 7


def dfs(cur, par, k, g):
    ret = 1
    nc = 0 if par == -1 else 1
    for e in g[cur]:
        if e == par: continue
        nc += 1
        ret = ret * (k - nc) % mod
        ret = ret * dfs(e, cur, k, g) % mod
    return ret % mod


print(dfs(0, -1, k, g) * k % mod)
s = input()
s1 = s[:n//2]
s2 = s[n//2+1:]
if s1 == s2 and s2 ==  s2[::-1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
n = len(s)

s1 = s[:(n-1)//2]
s2 = s[(n+3)//2-1:]

if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
  print("Yes")
else:
  print("No")
n=int(input())
rowdata=[int(i) for i in input().split()]
rowdata.sort()

#nが偶数の時
if n%2==0:
    check=[]
    for i in range(1,n,2):
        check.append(i)
        check.append(i)
    if check==rowdata:
        print(int(2**(n/2)))
    else:
        print(0)
else:
    check=[]
    for i in range(0,n,2):
        if i==0:
            check.append(i)
        else:
            check.append(i)
            check.append(i)
    if check==rowdata:
        print(int(2**((n-1)/2)))
    else:
        print(0)

### FIXED CODE ###

n=int(input())

#データを並び替える
rowdata=[int(i) for i in input().split()]
rowdata.sort()

#nが偶数の時
if n%2==0:
    check=[]
    a=1
    for i in range(1,n,2):
        check.append(i)
        check.append(i)
    if check==rowdata:
        for i in range(int(n/2)):
            a*=2
            a=a%1000000007
        print(a)
    else:
        print(0)
        
#nが奇数の時
else:
    check=[]
    a=1
    if n==1:
        check=[0]
    else:
        for i in range(0,n,2):
            if i==0:
                check.append(i)
            else:
                check.append(i)
                check.append(i)
    if check==rowdata:
        for i in range(int((n-1)/2)):
            a*=2
            a=a%1000000007
        print(a)
    else:
        print(0)
N, K = [int(n) for n in input().split()]
 if N // 2 + N % 2 >= K:
     print("YES")
 else:
     print("NO")




### FIXED CODE ###

N, K = [int(n) for n in input().split()]
answer = "YES"
if N // 2 + N % 2 >= K:
    answer = "YES"
else:
    answer = "NO"

print(answer)
n,m = map(int,input().split())
s = set()
t = set()
for i in range(m):
  a,b = map(int,input().split())
  if a == 1 and b != n:
    s.add(b)
  if a != 1 and b == n:
    t.add(a)
 
for x in a:
  if x in b:
    print('POSSIBLE')
    exit()
print('IMPOSSIBLE')

### FIXED CODE ###

n,m = map(int,input().split())
s = set()
t = set()
for i in range(m):
  a,b = map(int,input().split())
  if a == 1 and b != n:
    s.add(b)
  if a != 1 and b == n:
    t.add(a)
 
if len(s&t) > 0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
X = input()
 
if 30 =< X :
	print("Yes")
else :
    print("No")

### FIXED CODE ###

print("Yes") if int(input()) >= 30 else print("No")
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append([a-1,b-1])
if n==2:
    print(0)
    exit()


def f(x,y,c):
    c += 1
    if len(edge)-1 >=x and x >= 0:
        for e in edge[x]:
            if e != y:
                if c > d and e >= 0 and e<= n-1:
                    used[e] = 1
                f(e,x,c)


if k % 2 == 0:
    d = k//2
    res = []
    for i in range(n):
        used = [0]*n
        f(i,-1,0)
        res.append(sum(used))
    print(min(res))
else:
    d = (k-1)//2
    res = []
    for e1 in alledge:
        used = [0]*n
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        res.append(sum(used))
    print(min(res))


### FIXED CODE ###

import sys
#input = sys.stdin.readline
n,k = map(int,input().split())
edge = [[] for i in range(n)]
alledge = []
for i in range(n-1):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
    alledge.append((a-1,b-1))

def f(x,y,c):
    global tmp
    c += 1
    for e in edge[x]:
        if e == y:
            continue
        if c > d:
            tmp +=1
        f(e,x,c)

sys.setrecursionlimit(4100000)

if k % 2 == 0:
    d = k//2
    ass = 2001
    for i in range(n):
        tmp = 0
        f(i,-1,0)
        ass = min(ass,tmp)
    print(ass)
else:
    d = (k-1)//2
    ass = 2001
    for e1 in alledge:
        tmp = 0
        f(e1[0],e1[1],0)
        f(e1[1],e1[0],0)
        ass = min(ass,tmp)
    print(ass)
l = [int(input()) for _ in range(int(input))]
HIGH = max(l)
print(sum(l)-int(HIGH//2))

### FIXED CODE ###

l = [int(input()) for _ in range(int(input()))]
print(sum(l)-int(max(l))//2)
N, X = map(int, input().split())
Ls = map(int, input().split())

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

print(count)

### FIXED CODE ###

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

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

if X<position:
    pass
else:
    count += 1

print(count)
A,B = map(int,input())
print(max(A*B,A-B,A+B))

### FIXED CODE ###

A,B = map(int,input().split())
print(max(A*B,A-B,A+B))
S=input()
T=input()
ans=0
for i in range(3):
    if S[i]==T[i]:
    ans+=1
print(ans)

### FIXED CODE ###

S=input()
T=input()
ans=0
for i in range(3):
 if S[i]==T[i]:
     ans+=1
print(ans)
n = int(input())

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = [0] * (n+1)
x = [0] * (n+1)
y = [0] * (n+1)

t[0] = 0
x[0] = 0
y[0] = 0

for i in range(n):
    t[i+1],x[i+1],y[i+1] = map(int,input().split())

aFlg = True #ダメとなるまでは見なしOK

for i in t:
  xm = 0
  ym = 0
  if i > 0:
    if x[i] > x[i-1]:
      xm = x[i] - x[i-1]
    else:
      xm = x[i-1] - x[i]

    if y[i] > y[i-1]:
      ym = y[i] - y[i-1]
    else:
      ym = y[i-1] - y[i]

    if xm + ym > t:  #動きすぎ
      aFlg = False
      break
    elif (t - (xm+ym))%2 == 1:  #そこには止まれない
      aFlg = False
      break

if aFlg:
  print('Yes')
else:
  print('No')
    

### FIXED CODE ###

n = int(input())

#1行ずつ読んでやる方がスマートだけど、とりあえず見た目わかりやすい方で

t = [0] * (n+1)
x = [0] * (n+1)
y = [0] * (n+1)

t[0] = 0
x[0] = 0
y[0] = 0

for i in range(n):
    t[i+1],x[i+1],y[i+1] = map(int,input().split())

aFlg = True #ダメとなるまでは見なしOK

for i,tm in enumerate(t):
  xm = 0
  ym = 0
  if i > 0:
    if x[i] > x[i-1]:
      xm = x[i] - x[i-1]
    else:
      xm = x[i-1] - x[i]

    if y[i] > y[i-1]:
      ym = y[i] - y[i-1]
    else:
      ym = y[i-1] - y[i]

    if xm + ym > (t[i] - t[i-1]):  #動きすぎ
      aFlg = False
      break
    elif ((t[i] - t[i-1]) - (xm+ym))%2 == 1:  #そこには止まれない
      aFlg = False
      break

if aFlg:
  print('Yes')
else:
  print('No')
from itertools import permutations

n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]
xy = sorted(xy, key=lambda xy: xy[0])

costs = []
for per in permutations(xy, n):
    cost = 1
    p = per[1][0] - per[0][0]
    q = per[1][1] - per[0][1]
    for i in range(2, n):
        if not (per[i][0] - per[i-1][0] == p and per[i][1] - per[i-1][1] == q):
            cost += 1
    costs.append(cost)
print(min(costs))


### FIXED CODE ###

n = int(input())
xy = set(tuple(map(int, input().split())) for _ in range(n))

costs = []
for a in xy:
    besides_a = xy - {a}
    for b in besides_a:
        p = b[0] - a[0]
        q = b[1] - a[1]
        arrow_num = 0
        for c in xy:
            if (c[0] + p, c[1] + q) in xy:
                arrow_num += 1
        cost = n - arrow_num
        costs.append(cost)

if n == 1:
    print(1)
else:
    print(min(costs))
str.rfind()

### FIXED CODE ###

s = input()
print(s.rfind("Z")-s.find("A")+1)
num_list = list(int(input().split()))
product = num_list[0] * num_list[1]
if product % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

num_list = list(map(int,input().split()))
product = num_list[0] * num_list[1]
if product % 2 == 0:
  print("Even")
else:
  print("Odd")
N = int(input())
h = list(map(int, input().split()))
cnt=[0]*(N-1)
ans=[0]*(N-1)
counter=1
if N==1:
  print(0)
else:
  for i in range(N-1):
    if h[i] >= h[i+1]:
      cnt[i]=counter
    else:
      counter+=1
  for j in range(1,counter+1):
    ans[j]=cnt.count(j)
  print(max(ans))

### FIXED CODE ###

N = int(input())
H = [int(x) for x in input().split()]
dp = [0] * len(H) 
for i in range(1, len(H)):
  if H[i-1] >= H[i]: 
    dp[i] = dp[i-1] + 1
ans = max(dp)
print(ans)
n=int(input())print("Hello World" if n==1 else a=int(input() b=int(input() print(a+b)))

### FIXED CODE ###

n=int(input())
if n==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
# read = input
n = int(read())
s = read()
SW = [0 for i in range(n)]
SB = [0 for i in range(n)]
for i,c in enumerate(s):
    if i == 0:
        SW[i] = 1 if c == '.' else 0
        SB[i] = 1 if c == '#' else 0
    else :
        SW[i] = SW[i-1] + 1 if c == '.' else SW[i-1]
        SB[i] = SB[i-1] + 1 if c == '#' else SB[i-1]
cost = n
for i in range(n):
    pass
#     print(i, SW[i], SB[i])
for i in range(n + 1):
    startW = 0
    endW = i # left W is [0,i)
    startB = i 
    endB = n # right B is [i, n)
#     print(i)
    if i == 0: # all B 
        cost = min(cost, n - SW[n-1])
    elif i == n: # all W
        cost = min(cost, n - SB[n-1])
    else:
        cost = min(cost, 
                   i - SB[i-1] + (n-i) - (SB[n-1] - SB[i-1])
                  )
print(cost)
    

### FIXED CODE ###

read = input
n = int(read())
s = read()
SW = [0 for i in range(n)]
SB = [0 for i in range(n)]
for i,c in enumerate(s):
    if i == 0:
        SW[i] = 1 if c == '.' else 0
        SB[i] = 1 if c == '#' else 0
    else :
        SW[i] = SW[i-1] + 1 if c == '.' else SW[i-1]
        SB[i] = SB[i-1] + 1 if c == '#' else SB[i-1]
cost = n
for i in range(n):
    pass
#     print(i, SW[i], SB[i])
for i in range(n + 1):
    startW = 0
    endW = i # left W is [0,i)
    startB = i 
    endB = n # right B is [i, n)
#     print(i)
    if i == 0: # all B 
        cost = min(cost, SW[n-1])
    elif i == n: # all W
        cost = min(cost, SB[n-1])
    else:
        cost = min(cost, 
                   SB[i-1] + (SW[n-1] - SW[i-1])
                  )
#     print(i, cost)
print(cost)
import numpy as np

N = int(input())
A = list(map(int, input().split()))
rank = {}
for i in range(N):
    rank[A[i]] = str(i+1)
    
print(' '.joint(rank.values()))

### FIXED CODE ###

import numpy as np

N = int(input())
A = list(map(int, input().split()))
rank = {}
for i in range(N):
    rank[A[i]] = str(i+1)
    
print(' '.join(rank.values()))
a = 0
ans = 0
N = input()
for i in N :
  p = 0
  while i % 2 == 0 :
    N //= 2
    p += 1
  if a < p :
    a = p
    ans = i
print(ans)

### FIXED CODE ###

a = 0
ans = 0
N = int(input())
for i in range(1, N+1) :
  p = 0
  x = i
  while x % 2 == 0 :
    x //= 2
    p += 1
  if a <= p :
    a = p
    ans = i
print(ans)
a = int(input().split())

print(3*a*a)

### FIXED CODE ###

a = int(input())

print(3*a*a)
while True:
    H,W = map(int,input().split())
    if (H,W) = 0:
        break
    for i in range(H):
        print("#"*W)
    print()


### FIXED CODE ###

while True:
    H,W = map(int,input().split())
    if H == 0 and W==0:
        break
    for i in range(H):
        print("#"*W)
    print()
a = input()
print(a + a*a + a*a*a)

### FIXED CODE ###

a = input()
a = int(a)
print(a + a*a + a*a*a)
A, B, N = map(int, input().split())

def calc(x):
    return ((A * x) // B) - A * (x // B)

prit(max(calc(N), calc(B - 1)))


### FIXED CODE ###

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


def calc(x):
    return ((A * x) // B) - A * (x // B)


if B == 1:
    print(0)
elif B > N:
    print(calc(N))
else:
    print(calc(B - 1))
import math
import sys

def func(a,b,c,d,e,f):
    try:
        aa = a * a
        bb = b * b
        cc = c * c
        dd = d * d
        ee = e * e
        ff = f * f

        py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

        px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
            if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

        r = math.hypot(px - a, py - b)
        return px,py,r

    except ZeroDivisionError:
        return 0,0,10**6

n=int(input())

x,y=[],[]
for i in range(n):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)


if n==2:
    print(math.hypot(x[0]-x[1],y[0]-y[1])/2)
    sys.exit()
elif n==3:
    px,py,r=func(x[0],y[0],x[1],y[1],x[2],y[2])
    print(r)
    sys.exit()
    

minr=10**6
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            px,py,r=func(x[i],y[i],x[j],y[j],x[k],y[k])

            sgn=1
            for p in range(n):
                if math.hypot(x[p]-px,y[p]-py)>r+10**(-5):
                    sgn=0
            if sgn==1: minr=min(minr,r)

print(minr)

### FIXED CODE ###

n=input()
ans=chr(ord(n)+1)

print(ans)
n, y = map(int, input().split())
r = range(n+1)

ans = "-1 -1 -1"
for i in r:
    for j in r:
        k = (y-(10000*i+5000*j))//1000
        if k >= 0 and i+j+k == n:
            ans = f"{i} {j} {k}"

print(ans)


### FIXED CODE ###

N, Y = map(int, input().split())
ans = '-1 -1 -1'
for i in range(N + 1):
    for j in range(N + 1):
        k = N - (i + j)
        if k >= 0 and 10000 * i + 5000 * j + 1000 * k == Y:
            ans = '{} {} {}'.format(i, j, k)
            break
    else:
        continue
    break
print(ans)
a, b = map(int, input().split())
numbers = list(range(a, b + 1))
if a < 0:
    if 0 < b:
        print("Zero")
    elif numbers.index(-1) % 2 != 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Positive")


### FIXED CODE ###

a, b = map(int, input().split())
if 0 < a <= b:
    print("Positive")

elif a <= b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")

    else:
        print("Negative")
elif a <= 0 <= b:
    print("Zero")
a,b,c = map(int,input().split())
print(min(sum(a+b),sum(b+c),sum(c+a)))

### FIXED CODE ###

a,b,c = sorted(map(int,input().split()))
print(a+b)
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=[]
if m==1:
    print(0)
    exit()
if n==1:
    print(max(a)-min(a))
    exit()
for i in range(m-1):
    ans.append(abs(a[i+1]-a[i]))
total=0
ans.sort(reverse=True)
for i in range(n-1):
    total+=ans[i]
print(sum(ans)-total)

### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=[]
if m==1:
    print(0)
    exit()
if n==1:
    print(max(a)-min(a))
    exit()
for i in range(m-1):
    ans.append(abs(a[i+1]-a[i]))
total=0
ans.sort(reverse=True)
if len(ans)<=n:
    print(0)
    exit()
for i in range(n-1):
    total+=ans[i]
print(sum(ans)-total)
n=int(input())
a=list(map(int, input().split()))
b=[0]*(n-1)
j=0
for i in range(n-1):
    if a[i]>=a[i+1]:
        b[j]+=1
    else:
        j+=1
b.sort()
b.reverse()
print(b[0])

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
b=[0]*n
j=0
for i in range(n-1):
    if a[i]>=a[i+1]:
        b[j]+=1
    else:
        j+=1
b.sort(reverse=True)
print(b[0])
#文字列wordの文字の種類の構成のリストを返す関数
def connection_count(word)->list:
    i=0
    a=[]
    count=1
    while i<(len(word)-1):
        while word[i]==word[i+1]:
            count+=1
            i+=1
            if i>=(len(word)-1):
                break
        a.append(count)
        count=1
        i+=1
    if a[-1]==1:
        a.append(count)
    return a

#S:文字列、K：繰り返す回数
S=input()
K=int(input())

connection=[]

connection=connection_count(S)
print(connection)
if len(connection)==1:
    print(((connection[0]*K)//2))
elif S[0]!=S[-1]:
    connection2=map(lambda x:x//2,connection)
    print((sum(connection2)*K))
else:
    t=S*K
    connection3=connection_count(t)
    print(connection3)#
    connection4=map(lambda x:x//2,connection3)
    print(connection4)
    print(sum(connection4))


### FIXED CODE ###

import sys

#文字列wordの文字の種類の構成の表現のためのリストを返す関数
def connection_count(word)->list:
    i=0
    a=[]
    count=1
    while i<(len(word)-1):
        while word[i]==word[i+1]:
            count+=1
            i+=1
            if i>=(len(word)-1):
                break
        a.append(count)
        count=1
        i+=1
    if a[-1]==1:
        a.append(count)
    return a

#S:文字列、K：繰り返す回数
S=input()
K=int(input())

#Sが一文字の場合(例外処理）
if len(S)==1:
    print(K//2)
    sys.exit()

#Sの文字の種類の構成を表現するためのリスト
connection=connection_count(S)

#すべての文字が同じ場合
if len(connection)==1:
    print(((connection[0]*K)//2))
#最初と最後の文字が異なる場合
elif S[0]!=S[-1]:
    connection2=list(map(lambda x:x//2,connection))
    print((sum(connection2)*K))
#最初と最後の文字が同じ場合（すべての文字が同じ場合を除く）
else:
    t=S*2
    connection2=list(map(lambda x:x//2,connection))
    connection3=list(connection_count(t))
    connection4=map(lambda x:x//2,connection3)
    a=sum(connection2)
    b=sum(connection4)
    ans=a+(b-a)*(K-1)
    print(ans)
n = int(input())

ans = 0
for i in range(len(n)):
  ans += i
  
print(ans)

### FIXED CODE ###

n = int(input())

print(n * (n - 1) // 2)
def main():
    A,B = map(str,input().split())
    A = int(A)
    B.replace(',','')
    B = int(B)
    C = A*B
    print(C//100)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    A,B = map(str,input().split())
    A = int(A)
    B = B.replace('.','')
    B = int(B)
    C = A*B
    print(C//100)
    
if __name__ == '__main__':
    main()