peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b, t = map(int, input().split()); print((t//a)*b)
# Judge status: Accepted
l = float(input())

a = (l/3)**3

print(a)
# Judge status: Accepted
# coding:utf-8

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

for ans in range(1, 1001):
    if int(ans * 0.08) == A and int(ans * 0.1) == B:
        print(ans)
        exit(0)
print('-1')
# Judge status: Wrong Answer
def main():
    N = int(input())
    S = input()
    from collections import Counter
    c = Counter(S)
    result = 1
    if len(list(c.values())) < 3:
        return 0
    for v in c.values():
        result *= v
    piyo = (N-3) // 2
    for p in range(piyo+1):
        for i in range(N-1 - 2*p -1):
            hoge = S[i] + S[i+p+1] + S[i + (p+1)*2]
            if len(set(hoge)) == 3:
                result -= 1
    print(result)
main()
# Judge status: Accepted
N = input()
ans = "No"
for char in N:
    if char == "9":
        ans = "Yes"
        break

print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
result = (N+M)*(N+M-1)/2 - N*M
print(result)
# Judge status: Accepted
N = int(input())

TXY = [[0,0,0]]
for n in range(N):
  TXY.append([int(i) for i in input().split()])

ans = "Yes"
for i in range(N):
  sec = TXY[i+1][0] - TXY[i][0]
  length = abs(TXY[i+1][1] - TXY[i][1]) + abs(TXY[i+1][2] - TXY[i][2])

  if sec < length or (sec >= length and (length - sec)%2 == 1):
    ans = "No"
    break

print(ans)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

count = 0
for i in range(len(s)):
    if s[i:] != (t[:~i+1] if i > 0 else t):
        count += 1
    else:
        break

print(n + count)
# Judge status: Wrong Answer
import bisect
import copy
import heapq
import math
import sys
import random
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=998244353
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
b=float(b)
# print(a,b)
print(a*b//1)
# Judge status: Accepted
n,m = map(int, input().split())
like = {i:0 for i in range(1,m+1)}
for i in range(n):
    k,*a = map(int, input().split())
    for j in a:
        like[j]+=1
ans = 0
for i in range(1,m+1):
    if like[i]==n:ans+=1
print(ans)
# Judge status: Wrong Answer
n=int(input())
p=list( map(int, input().split()))
ans=0
for i in range(n-1):
    if (p[i-1]<p[i]<p[i+1]) or (p[i-1]>p[i]>p[i+1]):
        ans=ans+1
print(ans)
# Judge status: Wrong Answer
r = int(input('整数r(1<=r<=100)を入力 >>'))

S = r * r
SS = 1 * 1

nanbai = S / SS
print('半径{}の円の面積は半径1の円の面積の{}倍です'.format(r,int(nanbai)))
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))
T = 0
if N > 2:
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            for k in range(j + 1, N):
                a = L[i]
                b = L[j]
                c = L[k]
                abc = sorted(list({a, b, c}))
                if len(abc) == 3 and abc[0] + abc[1] > abc[2]:
                    T += 1
print(T)
# Judge status: Wrong Answer
n = int(input())
l0 = 2
l1 = 1
sum_ = 0
for i in range(1,n):
    sum_ = l0 + l1
    l0 = l1
    l1 = sum_
print(sum_)
# Judge status: Accepted
s  = input()
n  = int(input())

s_mae = ''
s_ato = s

for _ in range(n):
    ipt = input()

    if ipt[0] == '1':
        s_mae, s_ato = s_ato, s_mae
    else:
        _, id_, s_ = ipt.split()
        is_head = True if id_ == '1' else False
        if is_head:
            s_mae += s_
        else:
            s_ato += s_

print(s_mae[::-1] + s_ato)
# Judge status: Wrong Answer
def jubge_winner():
    # ドロー
    A, B = map(int, input().split())
    # 大小判定
    if A > B:
        return 'Alice'
    elif A == B:
        return 'Draw'
    elif A < B:
        return 'Bob'

# 実行
result = jubge_winner()
print(result)
# Judge status: Accepted
n = int(input())
ans = 0

for i in range(1, n + 1):
	if len(str(i)) % 2 == 1:
		ans += 1

print(ans)
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N, M = map(int, input().split())

    a = min(N, M // 2)
    M -= 2 * a
    b = M // 4
    ans = a + b
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = input()
ans = 0

for i in range(len(n)):
    y = int(n[i])
    ans += y
    
if ans % 9 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import fractions
a, b, c, d = map(int, input().split())
print((b-a+1)-(((b//c)+(b//d))-(((a-1)//c)+((a-1)//d))-(b//(c*d//fractions.gcd(c,d)))))
# Judge status: Accepted
N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
Sum = 0

if N >= M:
    print(0)
else:
    Dist = [0]*(M-1)
    for i in range(M-1):
        Dist[i] = X[i+1] - X[i]
        Sum += Dist[i]

    Dist.sort(reverse=True)
    for j in range(N-1):
        Sum -= Dist[j]

    print(Sum)
# Judge status: Accepted
from itertools import permutations
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
a=0
b=0

for i,p in enumerate(permutations(range(1,N+1))):
    if p==P:
        a = i
    if p==Q:
        b = i

print (abs(a-b))
# Judge status: Accepted
D = 365
for i in range(D):
    print(i % 26 + 1)
# Judge status: Wrong Answer
s = input()
for i in s:
    if s.count(i) != 1:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
import math
k=int(input())
print((k//2)*(math.ceil(k//2)))
# Judge status: Accepted
N,M = map (int, input ().split ())
X = round((N*(N-1))/2)
Y = round((M*(M-1))/2)
print (X+Y)
# Judge status: Accepted
s = input()
k = int(input())
n = len(s)
for i in range(n):
  num = ord(s[i])
  if num == 97 or 123-num > k:
    continue
  k -= (123-num)
  s = s[:i] + 'a' + s[i+1:]
if k > 0:
  t = k%26
  s = s[:n-1] + chr(ord(s[n-1])+t)
print(s)
# Judge status: Accepted
A,B = map(int,input().split())
if 0 < A and A <= B:
	print("Positive")
elif B < 0 and A <= B:
	if (B - A + 1) % 2 == 0:
		print("Positive")
	else:
		print("Negative")
else:
	print("Zero")
# Judge status: Accepted
d = int(input())

if d % 1000 == 0:
    print(0)
else:
    print(1000 - d % 1000)
# Judge status: Wrong Answer
x,y,z = map(int,input().split())

ans = int(x/(y+z))
if x%(y+z)-z >=0:
    ans -= 1
print(ans,x%(y+z))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
As = list(mapint())
As.sort()

from bisect import bisect_right
maxA = As[-1]
idx = bisect_right(As, maxA/2)

if abs(As[idx]-(maxA/2))>=abs(As[idx-1]-(maxA/2)):
    print(maxA, As[idx-1])
else:
    print(maxA, As[idx])
# Judge status: Wrong Answer
# ABC149B - Greedy Takahashi
def main():
    A, B, K = map(int, input().split())
    if K <= A:
        print(A - K, B)
    else:
        print(0, B - (K - A))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import queue

def main():
    n = int(input())
    A = list(map(int,input().split()))
    A = sorted(A,reverse=True)
    q = queue.PriorityQueue()
    q.put([A[0],A[0]])
    ans = 0
    for a in A[1:]:
        _min, _max = q.get()
        ans += _min
        q.put([a,_min])
        q.put([a,_max])
    print(ans)
    return 

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math
monsters = [int(input())]
attack_count = 0
while sum(monsters) > 0:
	attack_count += 1
	if monsters[0] == 1:
		del monsters[0]
	else:
		new_h = math.ceil(monsters[0]/2)
		del monsters[0]
		new_monsters = [new_h, new_h]
		monsters.extend(new_monsters)
print(attack_count)
# Judge status: Wrong Answer
n = int(input())
m = 1
for i in range(1, n):
    if i * (i + 1) // 2 >= n:
        m = i
        break
l = list(range(1, m + 1))
if m * (m + 1) // 2 > n:
    l.remove(m * (m + 1) // 2 - n)
print(*l, sep="\n")
# Judge status: Wrong Answer
K, N = map(int,input().split())
A = input().split()
for i in range(N):
    A[i] = int(A[i])
max = 0
for i in range(N-1):
    diff = abs(A[i] - A[i+1])
    if diff >= max:
        max = diff

if abs(K - A[N-1]) >= max:
    max = abs(K - A[N-1])

print(K - max)
# Judge status: Accepted
# maspy
p=list(map(int,input()))

def solve(n):
    dp=0,1
    for i in n:
        a=min(dp[0]+i,dp[1]+10-i)
        b=min(dp[0]+i+1,dp[1]+10-i-1)
        dp=a,b
    return dp[0]
print(solve(p))
# Judge status: Accepted
a,b,k=list(map(int,input().split()))
if a>=k:
    a=a-k
    print(a,b)
elif a<k:
    k=k-a
    b=b-k
    print(0,max(0,b))
# Judge status: Accepted
n = int(input())
for i in range(n, 1000):
    if len(set(str(i))) == 1:
        print(i)
        exit()
# Judge status: Accepted
a = int(input())
print((a // 2) * (a - a // 2))
# Judge status: Accepted
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
xyc = [list(map(int,input().split())) for i in range(M)]

# print(a,b,xyc)
ans = min(a)+min(b)
for i in range(M):
    x = a[xyc[i][0]-1]
    y = b[xyc[i][1]-1]
    nedan = x + y - xyc[i][2]
    if nedan < ans:
        ans = nedan
print(ans)
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
r=1 if d[0]==0 else 0
d=d[1:]
d.sort()
c=1
nc=0
j=1
mod=998244353
for i in d:
  if i<j:
    r=0
  elif i==j:
    nc+=1
    r=(r*c)%mod
  elif i==j+1:
    j=i
    c=nc
    nc=1
    r=(r*c)%mod
  else:
    r=0
print(r)
# Judge status: Accepted
n = int(input())
s = list(input())
b_c,w_c = s.count('#'),s.count('.')
ans = w_c
b_r,w_r = 0,0
for i in range(n-1):
    if s[i]=='#':b_r+=1
    else:w_r+=1
    if s[i]!=s[i+1]:
        ans = min(ans,b_r+w_c-w_r)
if s[-1]=='#':b_r+=1
else:w_r+=1
ans = min(ans,b_r+w_c-w_r)
print(ans)
# Judge status: Accepted
import numpy as np
import math
from functools import reduce

N,X,*x = map(int,open(0).read().split())
x.sort()
nx = np.array(x)
dif_nx = abs(X - nx)
print(reduce(math.gcd,dif_nx))
# Judge status: Accepted
s = input()
n = len(s)
a = [0]*(n+1)
for i in range(n):
    if s[i] == '<':
        a[i+1] = max(a[i] + 1, a[i+1])
for i in range(-1, -n-1, -1):
    if s[i] == '>':
        a[i-1] = max(a[i] + 1, a[i-1])
print(sum(a))
# Judge status: Accepted
x,y,z = map(int, input().split())
x, y = y, x
x, z = z, x
print(x, y, z)
# Judge status: Accepted
import bisect
import itertools
N, M, K = [int(_) for _ in input().split()]
A = list(itertools.accumulate([0] + [int(_) for _ in input().split()]))
B = list(itertools.accumulate([0] + [int(_) for _ in input().split()]))
ans = 0
for i, a in enumerate(A):
    if a > K:
        break
    ans = max(ans, i + bisect.bisect(B, K - a) - 1)
print(ans)
# Judge status: Wrong Answer
t_cookie, a_cookie, K = [int(i) for i in input().split(" ")]
 
t_cookie = t_cookie - K if t_cookie >= K else 0
a_cookie = a_cookie if t_cookie >= K else a_cookie - ( K - t_cookie )
 
print(t_cookie,a_cookie)
# Judge status: Wrong Answer
a,b = input().split(' ')
a = int(a)
b = int(b)
print(round((a+b)/2))
# Judge status: Accepted
x=int(input())

d=-(-x//11)
r=x%11
if 1<=r<=6:
  print(2*d-1)
else:
  print(2*d)
# Judge status: Accepted
def solve():
    x, y, z, n = [int(input()) for _ in range(4)]
    ans = 0
    for i in range(x+1):
        for j in range(y+1):
            for k in range(z+1):
                if 500 * i + 100 * j + 50 * k == n:
                    ans += 1
    return ans

print(solve())
# Judge status: Accepted
N = int(input())

List = [int(i) for i in input().split(" ")[::-1]]

Min = List[0]
i=1
flag = 0

for i in range(N):
    if (List[i]-Min)>=2:
        flag=1
        break
    else:
        if List[i]<Min:
            Min=List[i]
if flag==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b=map(str,input().split())
c=int(a+b)
h=[]
for i in range(1,110):
  h.append(i*i)
print('Yes' if c in h else 'No')
# Judge status: Accepted
def fn1(s):
	return s == s[::-1]
def fn2(s):
	n = len(s)
	x = s[:(n-1)//2]
	return x == x[::-1]
def fn3(s):
	n = len(s)
	x = s[(n+1)//2:]
	return x == x[::-1]

s = input()

if fn1(s) and fn2(s) and fn3(s):
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
N = input()
if len(N)==1:
    print(N)
    exit()
if all(c=='9' for c in N):
    print(len(N) * 9)
    exit()
ans = int(N[0])-1 + 9*(len(N)-1)
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int, input().split()))
    res = 1
    plus = 0
    minus = 0
    for i in range(n-1):
        if a[i + 1] - a[i] > 0:
            plus += 1
        elif a[i + 1] - a[i] < 0:
            minus += 1
        if plus and minus:
            res += 1
            plus = 0
            minus = 0
    print(res)
if __name__ == '__main__':
    main()
# Judge status: Accepted
N=int(input())
A=[int(x) for x in input().split()]
R=[0 for _ in range(N)]
for i in range(N-1):
  j=A[i]-1
  R[j]=R[j]+1
for x in R:print(x)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if  a==b :
    print("Draw")
elif b==1 or a<b or a!=1 :
    print("Bob")
else:
    print("Alice")
# Judge status: Wrong Answer
X,Y = map(int, input().split())

XY = []
XY.append(X)
XY.append(Y)

XY.sort()

if XY[1]%XY[0] == 0:
  print("-1")
  
else:
  print(X*(Y-1))
# Judge status: Wrong Answer
def solve():
    N = int(input())
    
    s = sum([i for i in range(1, N+1)])
    for i in reversed(range(1, N+1)):
        if s - i <= N:
            return i
        s -= i
        
print(solve())
# Judge status: Accepted
a,b,k=map(int, input().split())
if b-a+1>2*k:
  for i in range(a,a+k):
    print(i)
  for i in range(b-k+1,b+1):
    print(i)
else:
  for i in range(a,b+1):
    print(i)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l = sorted([i-k-1 for k,i in enumerate(l)])
a = l[n//2]
print(sum(abs(i-a) for i in l))
# Judge status: Accepted
numa, numb = input().strip().split()
numb = numb[:1]+numb[2:]
numa, numb = [int(numa),int(numb)]
ans = numa * numb
ans = str(ans)
if(len(ans)>2):
    print(ans[:-2])
else:
    print(0)
# Judge status: Accepted
s = int(input())

ans, num = [0, 0, 10 ** 9, 1], 10 ** 9
if s % num == 0:
    ans += [0, s // num]
elif s % num != 0:
    ans += [num - s % num, s // num + 1]
print(*ans)
# Judge status: Wrong Answer
import math
l=[]
f=0
for i in range(5):
    z=int(input())
    l.append(z)
k=int(input())
for i in range(4):
    for j in range(1,5):
        if math.fabs(l[i]-l[j])>=k:
            f=1
            break
if f==1:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
A, B, C, D= map(int,input().split())
if (A+D-1)//D < (C+B-1)//B:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort()
if l[-1]<sum(l[:-1]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S = input()
N = len(S)

for i in range(7+1):
  if S[:i] + S[i+N-7:] == "keyence":
    print("YES")
    exit()
print("NO")
# Judge status: Accepted
s = input()

l = list()

for i in range(len(s)):
    if s[i] == "0":
        l.append("0")
    elif s[i] == "1":
        l.append("1")
    else:
        if len(l) != 0:
            l.pop()

print(''.join(l))
# Judge status: Accepted
a = list(map(int, input().split()))
a.sort()
print(a[-1]*10+a[0]+a[1])
# Judge status: Accepted
a, b, c = map(int, input().split())
print("Yes" if max(a, b, c) != c and min(a, b, c) != c else "No")
# Judge status: Wrong Answer
n = int(input())
a = list()
for x in range(n):
    a.append(int(input()))

sumNum = sum(a)

for x in range(n):
    print(sumNum-a[x])
# Judge status: Accepted
from collections import deque
n,m=map(int,input().split())
A=[[] for i in range(n)]
for i in range(m) :
    a,b=map(int,input().split())
    A[b-1].append(a-1)
    A[a-1].append(b-1)
depth=[-1]*n
visit=deque([0])

while True :
    if len(visit)==0 :
        break
    x=visit.popleft()
    for i in A[x] :
        if depth[i]==-1 :
            depth[i]=x+1
            visit.append(i)

print("Yes")
[print(i) for i in depth[1:]]
# Judge status: Accepted
N,K = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
print(sum(P[:K]))
# Judge status: Accepted
R=int(input())
print(2*3.14*R)
# Judge status: Accepted
import math

def LI():
  return [int(s) for s in input().split()]

def distance(x,y):
  total = 0
  for x_i,y_i in zip(x,y):
    total+=(x_i - y_i)**2    
  return math.sqrt(total)

X = []

N,D = LI()

for i in range(N):
  X.append(LI())
  
count = 0

for i in range(N):
  for j in range(i+1,N):
    d = distance(X[i],X[j])
    if float.is_integer(d):
      count+=1
print(count)
# Judge status: Accepted
N,M=map(int,input().split())
if N==1:
  if M==1:
    print(1)
  else:
    print(M-2)
elif M==1:
  print(N-2)
else:
  print(N*M-2*max(0,N-1)-2*max(0,M-1))
# Judge status: Wrong Answer
n=int(input())
b=list(map(int,input().split()))
a=[b[0],b[n-2]]
for i in range(n-3):
  a.append(min(b[i],b[i+1]))
print(sum(a))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split(" ")))
right = sum(A)
left = 0
ans = float('inf')

for i in range(N - 1):
  left += A[i]
  right -= A[i]
  ans = min(ans, abs(left - right))

print(ans)
# Judge status: Wrong Answer
import sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
dp = [float('INF')]*(N+1)
for i in range(1,N+1):
    dp[i] = i
    num6,num9 = 6,9
    while 0<=i-num6<=N:
        dp[i] = min(dp[i],dp[i-num6]+1)
        num6 *= 6
    while 0<=i-num9<=N:
        dp[i] = min(dp[i],dp[i-num9]+1)
        num9 *= 9
print(dp[-1])
# Judge status: Wrong Answer
n,k=list(map(int,input().split()))
A=list(map(int,input().split()))
def sousa(a,k):
  B=[0]*len(a)
  for i in range(len(a)):
    for j in range(i-a[i],i+a[i]+1):
      if j>=0 and j<len(a):
        B[j]+=1
  k-=1
  return B if k==0 else sousa(B,k)
print(sousa(A,k))
# Judge status: Wrong Answer
n = int(input())

import math

ans = float('inf')
def calc(x,cnt):
    if x<6:
        global ans
        ans = min(ans,x+cnt)
    else:
        calc(x-6**int(math.log(x,6)),cnt+1)
        calc(x-9**int(math.log(x,9)),cnt+1)

calc(n,0)

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python
# -*- coding: utf-8 -*-

(K, S) = map(int, input().split(' '))

r = 0
for x in range(0, K + 1):
    for y in range(0, K + 1):
        if S - (x + y) <= K:
            r += 1

print(r)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

from fractions import gcd
left = [a[0]]
right = [0]*n
right[-1] = a[-1]

for i in range(1,n):
    left.append(gcd(left[-1], a[i]))

for i in range(n-2,-1,-1):
    right[i] = gcd(a[i], right[i+1])

ans = 0
for i in range(n):
    if i == 0:
        ans = max(ans,right[i+1])
    elif i == n-1:
        ans = max(ans, left[i-1])
    else:
        ans = max(ans, gcd(left[i-1],right[i+1]))

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
last = A[-1]
count = last
root = 1
for i in range(N):
  if root <= A[i]:
    print(-1)
    break
  if i+1 == N and root-A[i] > A[i+1]:
    root = last + A[i]
  elif root-A[i] > (last + A[i+1]):
    root = (last + A[i+1]) + A[i]
  count+=root
  root = (root-A[i])*2
else:
  print(count if count != 0 else -1)
# Judge status: Accepted
S = input()
if S[-1] == 's':
    S += 'es'
else:
    S += 's'
print(S)
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())
Q *= 4
H *= 2
ans = 0
if N & 1:
    ans += min(Q, H, S)
ans += min(2*Q, 2*H, 2*S, D)*(N//2)
print(ans)
# Judge status: Accepted
import numpy as np
A,B,N = map(int,input().split())
if B <= N:
    x = B-1
    print(int(np.floor(A*x/B)))
else:
    print(int(np.floor(A*N/B)))
# Judge status: Accepted
n,q = map(int,input().split())
s=input()
LR=[]
for i in range(q):
    l,r = map(int,input().split())
    LR.append([l,r])

c=0
p=0
C=[]
for i in range(len(s)):
    if s[i]=="A":
        p=1
    elif p==1 and s[i]=="C":
        c+=1
        p=0
    else:
        p=0
    C.append(c)

for i in range(q):
    l=LR[i][0]
    r=LR[i][1]
    ans = C[r-1]-C[l-1]
    print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

count = 0

for i, x in enumerate(b):
    for j in range(i, i+2):
        if a[j] >= x:
            count += x
            a[j] -=  x
            break
        else:
            count = count + a[j]
            x -= a[j]
print(count)
# Judge status: Accepted
N, M = map(int, input().split())

ans = N * (N - 1) // 2 + M * (M - 1) // 2

print(ans)
# Judge status: Wrong Answer
s = input()
if s[-1] == 's':
    print(s[:-1]+"es")
else:
    print(s+'s')
# Judge status: Accepted
L, R = list(map(int, input().split()))

a = 0
ans = 10 ** 9
r = min((L + 2018), R)

for i in range(L, r):
    n = min((i + 2019), R)
    for j in range(i + 1, n + 1):
        a = (i * j) % 2019
        # print(a)
        ans = min(a, ans)
print(ans)
# Judge status: Accepted
N,x=map(int,input().split())
a=list(map(int,input().split()))

count=0
if a[0]>x:
    count=(a[0]-x)
    a[0]=x

for i in range(1,N):
    if a[i]+a[i-1]>x:
        count+=(a[i]+a[i-1]-x)
        a[i]=x-a[i-1]
print(count)
# Judge status: Accepted
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

#ここから書き始める
n = int(input())
x = list(map(int, input().split()))
x_sorted = sorted(x)
left = x_sorted[n // 2 - 1]
right = x_sorted[n // 2]
for i in x:
    if i <= left:
        print(right)
    else:
        print(left)
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
print('U'*(ty-sy)+'R'*(tx-sx)+'D'*(ty-sy)+'L'*(tx-sx)+'L' \
      +'U'*(ty+1-sy)+'R'*(tx+1-sx)+'D'+'R'+'D'*(ty+1-sy) \
      +'L'*(tx+1-sx)+'U')
# Judge status: Accepted
n = int(input())
ll = [input() for _ in range(n)]

check = 0
i = 0
for i in range(len(ll)-1):
    if ll[i] in ll[i+1:]:
        check = 1
    if ll[i][len(ll[i])-1] != ll[i+1][0]:
        check = 1

if check == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
b=list(map(int,input().split()))

S=[b[0]]*n
for i in range(n-2):
    S[i+1]=min(b[i],b[i+1])

S[-1]=b[-1]
print(sum(S))
# Judge status: Wrong Answer
n, k = list(map(int, input().split()))
h = [int(input()) for i in range(n)]

h.sort()
k //= 2
ans = 1e+12
for i in range(k, n-k):
  ans = min(ans, h[i+k] - h[i-k])
  
print(ans)
# Judge status: Wrong Answer
N, K = map(int,input().split())
count = 0
while N > K :
  N = int(N / K)
  count += 1
print(count + 2)
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
c = [list(map(int, input().split())) for i in range(m)]
for i in range(n):
    ans, num = 10*10, 0
    for j in range(m):
        tmp = abs(a[i][0] - c[j][0]) + abs(a[i][1] - c[j][1])
        if tmp < ans:
            ans = tmp
            num = j + 1
    print(num)
# Judge status: Accepted
N,M = map(int,input().split())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
div = sorted(make_divisors(M))
div = [i for i in div if M//i >= N]
print(div[-1])
# Judge status: Wrong Answer
import numpy
a,b = map(int,input().split())
li = list(map(int,input().split()))
L = [(i**2+i)/(2*i) for i in li]
dp=[0]*a
res = numpy.cumsum(L)
dp[0] = res[b-1]-res[0]
for i in range(1,a-b+1):
    dp[i] = res[i+b-1]-res[i-1]
print(max(dp))
# Judge status: Wrong Answer
n, k = map(int, input().split())
s = list(map(str, input().split()))[0]

ans = 0
w = 0
for i in range(n-1):
    if s[i+1] == s[i]:
        ans += 1
    else:
        w += 1

if w == 0:
    p = [0]
elif w == 1:
    p = [1]
else:
    p = [2 for _ in range(w-1)] + [1]

ans + sum(p[:k])


print(ans + sum(p[:k]))
# Judge status: Wrong Answer
x, n = map(int, input().split())
p = list(map(int, input().split()))

def main():
    if len(p) == 0:
        print(x)
        return

    ans_l = list(range(x-10, x+10))

    diff_l = list(set(p) ^ set(ans_l))
    diff_l.sort()

    cnt = 100
    ans = 100
    for i in range(0, len(diff_l)):
        check = abs(diff_l[i]-x)
        # print(check)
        if check < cnt:
            cnt = check
            ans = diff_l[i]
    print(ans)
    return

main()