peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
    N, *A = map(int, open(0).read().split())
    for i in range(N):
        A[i] -= i + 1
    A.sort()
    print(sum(A[N // 2 + N % 2:]) - sum(A[:N // 2]))
    return


main()
# Judge status: Wrong Answer
N = int(input())
*A, = map(int, input().split())
cnt = sum([1 for i in range(N) if A[i] < 0])
if cnt % 2 == 0:
    print(sum([abs(a) for a in A]))
else:
    A.sort(key=abs)
    print(sum([abs(a) for a in A[1:]]) - A[0])
# Judge status: Wrong Answer
times = int(input())

power = 1
for i in range(1, times+1):
  power = power*i
print(power)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A_sum = [a-i for i,a in enumerate(A)]
middle = sorted(A_sum)[len(A)//2]

f = [abs(a-middle) for a in A_sum]
print(sum(f))
# Judge status: Accepted
def main():
    n = int(input())
    s = list(input())

    s_b = [1 if c=='#' else 0 for c in s]
    s_w = [1 if c=='.' else 0 for c in s[::-1]]

    s_b = cumsum(s_b)
    s_w = cumsum(s_w)[::-1]

    ans = []
    for i in range(n):
        ans.append(s_b[i]+s_w[i+1])

    print(min(ans))

def cumsum(a):
    s = 0
    sums = [0]
    for a_i in a:
        s+=a_i
        sums.append(s)

    return sums


if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, K, S = [int(x) for x in input().split()]
ans = [S] * K
if S == 10 ** 9:
    ans += [1] * (N - K)
else:
    ans += [(10 ** 9) - S] * (N - K)
print(*ans)
# Judge status: Wrong Answer
from itertools import combinations_with_replacement
n=int(input())
L='abcdefghij'
Li=L[:n]
kumiawase=list(combinations_with_replacement(Li, n))
for kumi in kumiawase:
    print(''.join(kumi))
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))
from heapq import *

n,m=nii()
a=lnii()
a=[-i for i in a]
a.sort(reverse=True)

heapify(a)

for i in range(m):
  x=heappop(a)
  x*=-1
  x//=2
  heappush(a,-x)

print(-sum(a))
# Judge status: Accepted
from collections import Counter
from collections import defaultdict

def main(n,k,r,s,p,t):
    score = 0
    for i in range(len(t)):
        if i < k:
            continue
        if t[i] == t[i-k]:
            t[i] = "N"
    c = Counter(t)
    i = defaultdict(int,c)
    score += i["r"]*p + i["s"]*r + i["p"]*s
    return score
    
n,k = map(int, input().split())
r,s,p = map(int, input().split())
t = list(input())
print(main(n,k,r,s,p,t))
# Judge status: Accepted
s = input()
s_start = 0
s_end = 0
count = 0

# 文字列sを右から探索できるように逆順に変換する
s_reverse = s[::-1]
# print(s_reverse)

for i in s:
    if i == 'A':
        s_start = count
        break
    count += 1

# カウンタcountを逆順用に変更（降順）
count = len(s) - 1

for j in s_reverse:
    if j == 'Z':
        s_end = count
        break
    count -= 1

ans = s_end - s_start + 1
print(ans)
# Judge status: Accepted
n = int(input());

sf = [ [0]*2 for i in range(n) ];
for i in range(n) :
	xl = input().split(' ');
	sf[i][0] = int(xl[0]) - int(xl[1]);
	sf[i][1] = int(xl[0]) + int(xl[1]);
	

sf.sort(key=lambda x:x[1] );

ans = 1;
end = sf[0][1];
for i in range(1,n) :
	if end <=  sf[i][0] :
		end = sf[i][1];
		ans += 1;

print(ans);
# Judge status: Accepted
n, x, y = map(int, input().split())
x, y = x-1, y-1

ans = [0] * n
for i in range(n):
    for j in range(i+1, n):
        ind = min(j-i, abs(x-i)+abs(y-j)+1)
        ans[ind] += 1

for k in range(1, n):
    print(ans[k])
# Judge status: Accepted
n,m = map(int,input().split())
if abs(n-m) > 1:
  print(0)
  exit()
  
mod = 10**9+7

if n==m:
    ans = 2
    a = 1
    for i in range(1,n+1):
        a *= i
        a %= mod
    print(ans*a**2%mod)
  
else:
    if m > n:
        n,m = m,n
    ans = 1
    
    for i in range(1,m+1):
        ans *= i
        ans %= mod
      
    ans = ans**2*n
    ans %= mod
    print(ans)
# Judge status: Accepted
import collections

N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0

for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)
# Judge status: Accepted
N = int(input())
A = [int(input()) for i in range(N)]
count = A[0]//2
A[0] %= 2
for i in range(1,N):
    if A[i] == 0:
        continue
    if A[i-1] != 0:
        count += 1
        A[i] -= 1
    count += A[i]//2
    A[i] %= 2
print(count)
# Judge status: Accepted
n = int(input())
s = input()

over = 0
ans_f = 0
ans_e = 0
for c in s:
    if c == "(":
        over += 1
    else:  # )
        if over > 0:
            over -= 1
        else:
            ans_f += 1

ans_e = over

ans = ("(" * ans_f) + s + (")" * ans_e)
print(ans)
# Judge status: Accepted
import bisect

n = int(input())
D = list(map(int, input().split()))
if D[0] != 0:
  print(0)
else:
  c = 1
  temp = 1
  e = 1
  D.sort()
  m = D[-1]
  if n > 1 and D[1] == 0:
    print(0)
    exit()
  else:
    for i in range(1, m+1):
      a = bisect.bisect_right(D, i)
      d = a - temp
      temp = a
      if d == 0 and i>0:
        print(0)
        exit()
      else:
        c *= e**d
        c %= 998244353
        e = d
    print(c)
# Judge status: Accepted
import math
N, D=list(map(int, input().split()))
print(math.ceil(N/(2*D+1)))
# Judge status: Accepted
x, y = map(int, input().split())
for i in range(x+1):
  if 2*i + 4*(x-i) == y:
    print('Yes')
    break
else:
  print('No')
# Judge status: Wrong Answer
a,v = list(map(int, input().split()))
b,w = list(map(int, input().split()))
t = int(input())

diff = abs(a-b)
V = abs(v-w)
if V <= 0:
    print('NO')
else:
    if diff<=V*t:
        print('YES')
    else:
        print('NO')
# Judge status: Accepted
import bisect
n=int(input())
a=[]
lis=[]
for i in range(n):
  inp=int(input())
  a.insert(bisect.bisect_left(a,inp),inp)
ans=0
bef=a[0]
co=0
for i in a[1:]:
  if i!=bef:
    ans+=(co+1)%2
    co=0
    bef=i
  else:
    co+=1
ans+=(co+1)%2
print(ans)
# Judge status: Accepted
_, *A = map(lambda x: int(x) - 1, open(0).read().split())
A = list(A)
pos = 0
cnt = 1
for i in range(10 ** 5 + 1):
    pos = A[pos]
    if pos == 1:
        print(cnt)
        break
    cnt += 1
else:
    print(-1)
# Judge status: Accepted
a,b=map(int,input().split())
ans=0
k=1
while k<b:
  k=k-1+a
  ans+=1
print(ans)
# Judge status: Accepted
n = int(input())
al = list(map(int, input().split()))

accum = []
csum = 0
for a in al:
    csum += a
    accum.append(csum)

asum = accum[-1]
ans = 10**10
for a in accum[:-1]:
    x = a
    y = asum-x
    ans = min(ans, abs(x-y))

print(ans)
# Judge status: Accepted
import math

R=int(input())

print(2*math.pi*R)
# Judge status: Accepted
n = int(input())
ans = 0
for a in range(1, n):
  ans += (n - 1) // a
print(ans)
# Judge status: Wrong Answer
n = input()
n = str(int(n) - 999)
ans = "ABD" + n.zfill(3)
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(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(h[i] - h[i + j]))
print(dp[N - 1])
# Judge status: Accepted
n, x, t = [int(x) for x in input().split()]
print( (n // x) * t + (n % x > 0) * t )
# Judge status: Accepted
from collections import deque

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

check = [0] * N

for i in reversed(range(1, N + 1)):
    if sum(check[i - 1::i]) % 2 != A[i - 1]:
        check[i - 1] = 1

M = sum(check)
ans = deque()

for index, value in enumerate(check):
    if value == 1:
        ans.append(index + 1)

print(M)
if M > 0:
    print(*ans)
# Judge status: Accepted
#ABC122C 累積和
from itertools import accumulate
A = []
N, Q = map(int, input().split())
B = [0]*N
S = list(input())
ans = []
for i in range(1, N):
    if S[i-1]=='A' and S[i]=='C':
        B[i] = 1
A = list(accumulate(B))
for j in range(Q):
    l, r = map(int, input().split())
    ans.append(A[r-1]-A[l-1])
print('\n'.join(map(str, ans)))
# Judge status: Accepted
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
idx = r = 0
while idx < n:
    if idx == 0: idx += k
    else: idx += k - 1
    r += 1
print(r)
# Judge status: Accepted
a, b = input().split()
a = int(a)
b = round(float(b) * 100)
print(a * b // 100)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if b>a:
    print(a)
else:
    print(a-1)
# Judge status: Accepted
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x, y = map(int,input().split())
if x in a and y in a or (x in b and y in b): print("Yes")
else: print("No")
# Judge status: Wrong Answer
n = int(input())
print(1000-(n%1000))
# Judge status: Accepted
a = list(map(int,input().split()))

N = a[0]
K = a[1]

if K >= 2*N:
    print(N)
elif K > N :
    print(abs(N-K))
elif N >= K:
    res = N%K
    min = res
    cul_result1 = abs(res-K)
    if cul_result1 < min:
        min = cul_result1
    cul_result2 = abs(cul_result1-K)
    if cul_result2 < min:
        min = cul_result2
    print(min)
# Judge status: Accepted
N = int(input())
A = [int(T) for T in input().split()]
Color = [T//400 for T in A if T<3200]
ColL = len(Color)
SetL = len(set(Color))
MIN = max(1,SetL)
MAX = SetL+(N-ColL)
print('{} {}'.format(MIN,MAX))
# Judge status: Wrong Answer
S = input().split()
A = int(S[0])
B = float(S[1])
 
print(((A*B)))
# Judge status: Accepted
a, b, c, k = map(int, input().split(" "))

if a >= k:
    print(k)
elif a + b >= k:
    print(a)
else:
    print(a - (k-(a+b)))
# Judge status: Accepted
import numpy as np

n = int(input())
ab = []

for _ in range(n):
    ab.append(list(map(int, input().split())))

a = np.array([x[0] for x in ab])
b = np.array([x[1] for x in ab])


ans = 0
for x, y in zip(a[::-1], b[::-1]):
    mod = (x + ans) % y
    if mod == 0:
        continue
    else:
        add = y - mod
        ans += add

print(ans)
# Judge status: Accepted
N, W = map(int, input().split())
wt, val = [], []
for i in range(N):
	w,v = map(int, input().split())
	wt.append(w)
	val.append(v)

K = [[0 for x in range(W+1)] for y in range(N+1)]

for i in range(N+1):
	for w in range(W+1):
		if i == 0 or w == 0:
			K[i][w] = 0
		elif wt[i-1] <= w:
#			print("ayo")
			K[i][w] = max(val[i-1]+K[i-1][w-wt[i-1]], K[i-1][w])
		else:
			K[i][w] = K[i-1][w]
print(K[N][W])
# Judge status: Accepted
k = int(input())

def lunlun(x):
    s = str(x)
    good = 0
    for i in range(1, len(s)):
        if abs(int(s[i - 1]) - int(s[i])) > 1:
            # what is the "digit value" of s[i]
            return 10 ** (len(s) - i - 1)
    return good

n = 1
last = 0
total = 0
while total < k:
    skip = lunlun(n)
    if skip == 0:
        last = n
        total += 1
        n += 1
    else:
        n += skip

print(last)
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readline_s = sys.stdin.readline
readlines = sys.stdin.buffer.readlines


def main():

    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    if abs(a - e) <= k:
        ans = 'Yay!'
    else:
        ans = ':('

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N,M=map(int,input().split())
G=[[] for _ in range(N+1)]
for i in range(M):
  a,b=map(int,input().split())
  G[a].append(b)
  G[b].append(a)

ans=[0]*(N+1)
checked=[False]*(N+1)
d=[1]
while d:
  c=d.pop()
  for g in G[c]:
    if not checked[g]:
      d.append(g)
      checked[g]=True
      ans[g]=c

print('Yes')
for i in range(2, len(ans)):
  print(ans[i])
# Judge status: Wrong Answer
a = input()
if a==0:
  print(1)
else:
  print(0)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l.sort()
if n <= 2:
    print(0)
    exit()

cnt = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        if l[i] != l[j]:
            for k in l[j+1:]:
                if k < l[i]+l[j] and k != l[i] and k != l[j]:
                    cnt += 1
print(cnt)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

# B - fLIP
n, m, k = map(int, input().split())
black = 0

for i in range(m):
	black += n
	
	for j in range(n):
		if j > 0:
			if i == 0:
				black += m
			else:
				black += m - 1
	
		if black == k:
			print('Yes')
			sys.exit()

print('No')
# Judge status: Accepted
s = input()
if s=='a' or s=='i' or s=='u' or s=='e' or s=='o':
  print('vowel')
else:
  print('consonant')
# Judge status: Accepted
a,b=list(map(int,input().split()))
if b>=a:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
# coding: utf-8

# https://atcoder.jp/contests/abc101


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ans = 1
    N -= K
    if N % (K-1) == 0:
        ans += N // (K-1)
    else:
        ans += N // (K-1) + 1
    
    return ans


print(main())
# Judge status: Accepted
x,a,b = map(int,input().split())
if -a + b <= 0:
    print("delicious")
elif 0 < -a + b < x+1:
    print("safe")
elif -a + b >= x+1:
    print("dangerous")
# Judge status: Wrong Answer
import heapq
n,m=map(int, input().split())
lst = []
for i in range(n):
  a,b=map(int, input().split())
  lst.append((-b,a))
lst = sorted(lst, key=lambda x:x[1])

now_idx = 0
queue = []
sum_ = 0
for i in range(1,m+1):
  for j in range(now_idx, n):
    if lst[j][1] <= i:
      heapq.heappush(queue, lst[j])
    else:
      now_idx = j
      break
  if len(queue)>0:
    sum_ -= heapq.heappop(queue)[0]
print(sum_)
# Judge status: Wrong Answer
# AGC 04

a, b, c = map(int, input().split())
if c % 2 != 0:
    print(a * b)
else:
    print(0)
# Judge status: Wrong Answer
n = int(input())

ans=''
while n > 0:
    ans = chr(ord('a') + (n % 26) -1) + ans
    n //= 26
    
print(ans)
# Judge status: Accepted
X,Y = map(int,input().split())

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def combi(n,r,mod=10**9+7):
    fac = [0]*(n+1)
    fac[0] = 1
    fac[1] = 1
    for i in range(2,n+1):
        fac[i] = fac[i-1] * i % mod
    return( ( fac[n] * modinv(fac[r]) )%mod * modinv(fac[n-r]) % mod)

if (X+Y) % 3 != 0 or X > 2*Y or Y > 2*X:
    print(0)
else:
    n = X - (X + Y)//3
    m = (X + Y)//3 - n
    print(combi(n+m,m))
# Judge status: Accepted
H = int(input())
c = 1
while H != 1:
    H = H // 2
    c += 1
print(2 ** c - 1)
# Judge status: Accepted
s = input()
ans = ''
if s == 'keyence':
  ans = 'YES'
else:
  for i in range(len(s) - 7):
    for j in range(len(s) - i):
      if s[:j] + s[j + i + 1:] == 'keyence':
        ans = 'YES'
        break
if ans == '':
  ans = 'NO'
print(ans)
# Judge status: Wrong Answer
s = "atcoder"
l = len(s)
s1 = s[:int((l-1)/2)]
s2 = s[int((l+3)/2) - 1:]
if (s1 == s1[::-1]) and (s2 == s2[::-1]):
    print("Yes")
else :
    print("No")
print(s1,s2)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
d = {}
ans = 0
for i in range(n):
    if i-a[i] in d:
        ans += d[i-a[i]]
    if i+a[i] in d:
        d[i+a[i]] += 1
    else:
        d[i+a[i]] = 1
print(ans)
# Judge status: Accepted
#6
import sys
H,W = map(int,input().split())
k = H*W

if H ==1 or W == 1:
    print(1)
    sys.exit()

if k%2 == 0:
    print(int(k/2))
else:
    print(int(k/2)+1)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
import math
from sys import stdin
input = stdin.readline


def main():
  a, b, x = list(map(int, input().split()))

  # y = 2*(b-(x/a**2))/a
  # yd = 2*x/(a*b**2)
  # print(y, yd)
  if x > 0.5*a*a*b:
    print(math.degrees(math.atan( 2*(b-(x/a**2))/a )))
  else:
    print(90 - math.degrees(math.atan( (2*x/(a*b**2)) )))


if(__name__ == '__main__'):
  main()
# Judge status: Accepted
def main():
    N = int(input())
    S = input()

    memo = [0]*(N+1)
    for i, ss in enumerate(S, 1):
        if ss == 'I':
            memo[i] = memo[i-1] + 1
        else:
            memo[i] = memo[i-1] - 1

    print(max(memo))


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

n = int(input())

dict = {}
for i in range(26):
    dict[chr(ord('a') + i)] = 50

for _ in range(n):
    S = input()
    for char in dict.keys():
        dict[char] = min(dict[char], S.count(char))
    
ans = ''
for char, num in sorted(dict.items()):
    ans += (char * num)

print(ans)
# Judge status: Accepted
import sys
a,b=map(int,input().split())
if (a==1 and b==13):
  print('Alice')
  sys.exit()
else:
  pass
if a==13 and b==1:
  print('Bob')
  sys.exit()
else:
  pass
if a>b:
  print('Alice')
elif a==b:
  print('Draw')
else:
  print('Bob')
# Judge status: Accepted
import numpy as np
N = input()
T, A = map(int, input().split())
H = np.array(input().split(), dtype=np.float64)
X = abs(T - H * 0.006 - A)
print(np.argmin(X) + 1)
# Judge status: Accepted
import math
N=int(input())
x=math.ceil(N/1.08)
if math.floor(x*1.08) == N:
  print(x)
else:
  print(":(")
# Judge status: Accepted
a,b=map(int,input().split())

c=a*b

if c%2==0:
    print('Even')
else:
    print('Odd')
# Judge status: Accepted
K, A, B = map(int, input().split())

if (A+2) >= B:
    print(K+1)
else:
    print((((K-A+1)//2)*(B-A))+((K-A+1)%2)+(A))
# Judge status: Accepted
H, A=list(map(int, input().split()))
if H%A==0:
    print(H//A)
else:
    print(H//A+1)
# Judge status: Wrong Answer
N,K=map(int,input().split())
p=list(map(int,input().split()))

E=[0]*N
for i in range(N):
    E[i]=(p[i]+1)/2

S=[0]*N
for i in range(N):
    S[i]=sum(E[:i])

A=[0]*(N-K+1)
for i in range(N-K):
    A[i]=S[i+K]-S[i]

print(max(A))
# Judge status: Accepted
X = int(input())

ans = 0
n = X // 500
X -= n * 500
ans = n * 1000
ans += (X // 5) * 5

print(ans)
# Judge status: Accepted
N=int(input())
list=[]
for i in range(N):
  A=int(input())
  list.append(A)
l=sorted(list,reverse=True)
A_1=l[0]
A_2=l[1]
for j in range(N):
  if list[j]!=A_1:
    print(A_1)
  else:
    print(A_2)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
c=1
d=0
for i in range(n-1):
  e=d+A[i+1]-A[i]
  if (d<e and d<0) or (d>e and d>0):
    c+=1
    e=0
  d=e
print(c)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

from fractions import gcd

N = int(input())

T = int(input())

for _ in range(N - 1):
    t = int(input())
    T = T * t // gcd(T, t)

print (T)
# Judge status: Accepted
w,h,n=map(int,input().split())
x1,x2=0,w
y1,y2=0,h
for i in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        x1 = max(x1,x)
    elif a==2:
        x2 = min(x2,x)
    elif a==3:
        y1 = max(y1,y)
    elif a==4:
        y2 = min(y2,y)
print(max((x2-x1)*(y2-y1),0) if x2-x1>0 else 0)
# Judge status: Accepted
k, s = map(int, input().split())
ans = 0
for a in range(k+1):
    for b in range(k+1):
        if 0 <= s - a - b <= k:
            ans += 1
print(ans)
# Judge status: Accepted
from sys import stdin
input = stdin.buffer.readline

n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]

h.sort()

ans = 10 ** 9
for i in range(n-k+1):
    diff = h[i+k-1] - h[i]
    if diff < ans:
        ans = diff

print(ans)
# Judge status: Accepted
N = list(map(int,input().split()))
N.sort()
A = N[0]
B = N[1]
C = N[2]
ans = 0
if max(N) == min(N):
  print(ans)
  exit()
if (B-A)%2 == 0:
  ans += (B-A)//2 + C - B
else:
  ans += 1
  B += 1
  C += 1
  ans += (B-A)//2 + C - B
  
print(ans)
# Judge status: Accepted
#!/usr/bin/env python

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

ans = ''
for i in range(n+1):
    if s[n-i:] == t[:i]:
        ans = s + t[i:]

print(len(ans))
# Judge status: Accepted
n, a, b = [int(x) for x in input().split()]
res = 0
for i in range(1, n + 1):
  s = str(i)
  cc = 0
  for j in s:
    cc += int(j)
  res += i * (a <= cc <= b)
print(res)
# Judge status: Wrong Answer
N = int(input())
resulter = "abcdefghijklmnopqrstuvwxyz"
# NS = str(N)

hoge = []
count = 10
while True:
    re = pow(26, count)
    if N > re:
        tmp = N // re
        hoge.append(resulter[tmp - 1])
        N = N - re * tmp
        # count = 10

    count = count - 1
    if count < 1:
        hoge.append(resulter[N - 1])
        break


print("".join(hoge))
# Judge status: Wrong Answer
n = int(input().strip())
count = 0
for i in range(n):
  a,b = map(int,input().strip().split())
  if a == b and count == 3:
    print('Yes')
    exit(0)
  elif a == b:
    count += 1
  elif(a != b):
    count = 0
if count == 3:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
D = int(input())
listC = list(map(int, input().split()))
answerL = []
for i in range(D):
    listS = list(map(int, input().split()))
    maxi = max(listS)
    target = listS.index(maxi)
    answerL.append(target+1)
for ans in answerL:
    print(ans)
# Judge status: Accepted
S = input()
alphabet_list = [chr(i) for i in range(97, 97 + 26)]
flag = 0
for moji in alphabet_list:
    if moji not in S:
        print(moji)
        flag = 1
        break
if not flag:
    print("None")
# Judge status: Accepted
n = int(input())
ans = 1001001001
for i in range(1,n):
    j = n-i
    i_sum, j_sum = 0, 0

    si, sj = list(str(i)), list(str(j))
    for s1 in si:
        i_sum += int(s1)
    for s2 in sj:
        j_sum += int(s2)

    ans = min(ans, i_sum+j_sum)

print(ans)
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(float, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

a, b = inm()
a = int(a)
b = int(b * 100 + 0.1)
print(a*b // 100)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

cnt = 1
length = K
while True:
    if length >= N:
        print(cnt)
        break
    length += K-1 
    cnt += 1
# Judge status: Accepted
a,b=list(map(int,input("").split(" ")))

if((a+b)%2 == 0):
    print((a+b)//2)

else:
    print("IMPOSSIBLE")
# Judge status: Accepted
N, M = map(int, input().split())
ans = min(N, M // 2) + max(M - 2 * N, 0) // 4
print(ans)
# Judge status: Accepted
from math import *
n = int(input())
a = sorted(map(int, input().split()))
g = a[0]
for i in range(1,n):
  g = gcd(g, a[i])
print(g)
# Judge status: Accepted
from decimal import Decimal
import math
a, b = map(Decimal,input().split())
print(math.floor(a*b))
# Judge status: Accepted
N=int(input())
l=[1,6,9,36,81,216,729,1296,6561,7776,46656,59049]
h=[None]*100001
h[0]=0
k=[0]
c=1
while None in h:
    t=[]
    for i in k:
        for j in l:
            if i+j>100000:
                break
            if h[i+j]==None:
                h[i+j]=c
                t.append(i+j)
    k=t
    c+=1
print(h[N])
# Judge status: Accepted
n = int(input())
s = input()
b = 0
w = s.count(".")
l = [w]
for i in range(1, n + 1):
    if s[i - 1] == "#":
        b += 1
    if s[i - 1] == ".":
        w -= 1
    l.append(b + w)
print(min(l))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
ans = [0] * 8
free = 0

for r in a:
    if r > 3199:
        free += 1
    else:
        ans[r // 400] = 1

min_ = max(sum(ans), 1)
#max_ = min(sum(ans) + free, 8)
max_ = sum(ans) + free
print(min_, max_)
# Judge status: Wrong Answer
K,X = map(int,input().split())
if K * 500 > X:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x, y = [int(i) for i in input().split()]

print(x + y//2)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
s = int(input())
happy = 0
if s >= 500:
    happy += 1000 * (s // 500)
    s = s % 500
if s >= 5:
    happy += 5 * (s // 500)

print(happy)
# Judge status: Wrong Answer
x, a, b  = map(lambda x: int(x),  input().split())

if b < a:
  print('delicious')
elif x >= b - a:
  print('safe')
else:
  print('dangerous')
# Judge status: Wrong Answer
import re
a,b = list(map(int,input().split()))
s = input()
if re.match(r"[1-9][1-9]*",s[0:a]):
  if s[a]=="-":
    if re.match(r"[1-9][1-9]*",s[(a+1):(a+b)]):
      if len(s)==a+b+1:
        print("Yes")
        exit()
print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

s = sum(a)
aa = sum(list(map(lambda x: x**2, a)))

total = int((s**2 - aa) / 2) % (10**9 + 7)
print(total)
# Judge status: Accepted
N = int(input())
S = input()

l = S.count('(')
r = S.count(')')
d = r - l

if d > 0:
    S = '(' * d + S
if d < 0:
    S = S + ')' * (-d)

l, r, d = 0, 0, 0
for s in S:
    if s == '(':
        l += 1
    if s == ')':
        r += 1
    d = max(d, r - l)

if d > 0:
    S = '(' * d + S + ')' * d

print(S)