peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, M = map(int, input().split())
L = [list(map(int, input().split())) for i in range(M)]
s = []
g = []
for i in range(M):
    if 1 == L[i][0]:
        s.append(L[i][1])
    if 1 == L[i][1]:
        s.append(L[i][0])
        
for i in range(M):
    if N == L[i][0]:
        g.append(L[i][1])
    if N == L[i][1]:
        g.append(L[i][0])
        
if set(g)&set(s):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
ret = ''
for i in range(1, n+1):
    ret += str(a.index(i) + 1)
print(' '.join(ret))
# Judge status: Accepted
import numpy as np

n, m = map(int, input().split())
A = np.array([list(input()) for _ in range(n)])
B = np.array([list(input()) for _ in range(m)])

for i in range(n-m+1):
    for j in range(n-m+1):
        if (A[i:i+m, j:j+m] == B).all():
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
import statistics
n=int(input())
la, lb = [], []
for _ in range(n):
  a, b =map(int, input().split())
  la.append(a)
  lb.append(b)
c=statistics.median(la)
d=statistics.median(lb)
if n%2==1:
  print(d-c+1)
else:
  print(int(2*d-2*c+1))
# Judge status: Accepted
N = int(input())
S = input()
black = 0
ans = 0

for s in S:
    if s == "#":
        black += 1
    else:
        if black > 0:
            ans += 1
            black -= 1

print(ans)
# Judge status: Accepted
n, k = list(map(int, input().split()))
print(min(n%k, abs(n%k -k)))
# Judge status: Wrong Answer
s = input()

if s[2]==[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
l = [int(input()) for i in range(5)]

if n % min(l) == 0:
    print(n // min(l) + 4)
else:
    print(n // min(l) + 5)
# Judge status: Wrong Answer
N = int(input())

ans = []
for i in range(1, N + 1, 2):
    count = 0
    if i == 105:
        print(105)
    for j in range(1, i // 2 + 1):
        if i % j == 0:
            count += 1
    if count == 7:
        ans.append(1)

print(sum(ans))
# Judge status: Wrong Answer
n,l=map(int,input().split())
if l<-n:
  print(n*(n-1)//2+(l-1)*(n-1))
elif -n<=l and l<0:
  print((n-1)*(l-1)+n*(n+1)//2)
else:
  print(n*(n-1)//2+(l-1)*(n-1)-1)
# Judge status: Accepted
n = int(input())

ans = 0

for a in range(1, n):
    t = (n-1) // a
    ans += t

print(int(ans))
# Judge status: Wrong Answer
N  = list(map(int, input().split()))

if N[2]-N[1] <= 0:
  if N[1] > N[3]:
    print(abs(N[3]-N[2]))
  else:
    print(abs(N[2]-N[1]))
else:
  print("0")
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
s = max(a, c)
f = min(b, d)
if b > c:
    print(f - s)
else:
    print(0)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

flag = 0
ans = 0

if a == b == c:
  ans = -1

else:
  while flag == 0:
    if a%2 == 1 or b%2 == 1 or c%2 == 1:
      flag = 1
      
    else:
      a_tmp = (b+c)/2
      b_tmp = (a+c)/2
      c_tmp = (a+b)/2
      
      a = a_tmp
      b = b_tmp
      c = c_tmp
      
      ans += 1

print(ans)
# Judge status: Accepted
from math import gcd
from itertools import product


def solve(string):
    k = int(string)
    ans = 0
    for a, b, c in product(range(1, k + 1), repeat=3):
        ans += gcd(gcd(a, b), c)
    return str(ans)


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
# Judge status: Wrong Answer
import timeit

a = [input() for i in range(2)]

S = a[0]
T = a[1]

def count_diff2(S,T):
    cnt = 0
    for c1,c2 in zip(S, T):
        if c1 != c2:
            cnt += 1
    return cnt

print(timeit.timeit(lambda: count_diff2(S,T)))
# Judge status: Accepted
line = input().rstrip().split(" ")
a = int(line[0])
b = int(line[1])
c = int(line[2])
d = int(line[3])

if b>= 0 and d >= 0:
    print(max(b * d, a * c))
elif b <= 0 and d >= 0:
    print(max(b * c, a * c))
elif b >= 0 and d <= 0:
    print(max(a * d, a * c))
else:
    print(a * c)
# Judge status: Accepted
N = int(input())
carry = [int(input()) for _ in range(5)]
min_carry = min(carry)
print((N + min_carry - 1) // min_carry + 4)
# Judge status: Wrong Answer
n,q = map(int,input().split())
s = list(input())
base = [0]*n
count = 0

for i in range(1,n):
  if (s[i-1] == "A") and (s[i] == "C"):
    count = count + 1
    base[i] = count
  else:
    base[i] = count

base[n-1] = base[n-2]

for i in range(q):
  l,r = map(int,input().split())
  ans = base[r-1] - base[l-1]
 
    
  print(ans)
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())

ans = [0] * (N-1)
for i in range(1,N+1):
	for j in range(i+1, N+1):
		k = min(j-i, abs(X-i) + abs(Y-j) + 1)
		ans[k-1] += 1

print(ans)
for i in range(N-1):
	print(ans[i])
# Judge status: Accepted
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
q = int(input())
a_sum = sum(a)
a_count = Counter(a)

for i in range(q):
    b, c = map(int, input().split())
    a_sum = a_sum + (c - b)*a_count[b]
    if a_count[c]:
        a_count[c] += a_count[b]
        a_count[b] = 0
    else:
        a_count[c] = a_count[b]
        a_count[b] = 0
    print(a_sum)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
pair = 0

for i in range(1,n-1):
    if min(l[i-1],l[i+1]) <= l[i] and l[i] <= max(l[i-1],l[i+1]):
        pair += 1 

print(pair)
# Judge status: Accepted
from collections import Counter


N, K = map(int, input().split())
counter = Counter(int(x) for x in input().split())

# 書き換えが必要な種類
i = len(counter) - K

if i < 1:
  print(0)
else:
  t = [(v, k) for k, v in counter.items()]
  t.sort()
  print(sum(v for v, k in t[:i]))
# Judge status: Accepted
n = int(input())
task = [list(map(int, input().split())) for i in range(n)]
task = sorted(task, key=lambda x: x[1])

time = 0
for i in range(n):
  time += task[i][0]
  if time > task[i][1]:
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
N,M = map(int,input().split())
 
if N == M:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if abs(a-b) == abs(b-c):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
d,n=map(int,input().split())
print(10**(2*d)*(n+n//100))
# Judge status: Accepted
n = input()
m = len(n)
dp0 = [0]*m
dp1 = [0]*m
dp1[0] = min(int(n[0])+2,11-int(n[0]))
dp0[0] = int(n[0])
for i in range(1,m):
    dp0[i] = min(dp0[i-1],dp1[i-1]) + int(n[i])
    if int(n[i]) != 9:
        dp1[i] = min(dp0[i-1]+int(n[i])+2,dp1[i-1]+min(int(n[i])+2,9-int(n[i])))
    else:
        dp1[i] = dp1[i-1]
print(min(dp0[m-1],dp1[m-1]))
# Judge status: Accepted
a,b=map(int, input().split())
print((a+b)%24)
# Judge status: Accepted
a,b,c,d = map(int, input().split())

t = (a+d-1)//d
o = (c+b-1)//b

if t >= o:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
x=int(input())
flag="False"
n=0
y=100
while flag=="False":
  n+=1
  y=int(y*1.01)
  if y>=x:
    flag="True"
print(n)
# Judge status: Wrong Answer
import math

S = int(input())
if S < 3:
    print(0)
    exit()


def check(s, i):
    re = (i ** s) % (10 ** 9 + 7)
    return re


n = S // 3

ans = 0
for i in range(n):
    S_i = S - (3 * (i + 1))
    ans += check(S_i, i + 1)
print(ans % (10 ** 9 + 7))
# Judge status: Accepted
import math
N = int(input())
num = 0
SQRTN = int(math.sqrt(N))
for i in range(1,SQRTN+1):
   if N % i == 0:
       num = i 
# print(num)
num_2 = N//num
print(num + num_2 -2)
# Judge status: Accepted
L,R,d=map(int,input().split())
ans = 0
for i in range(L,R+1):
    if i % d ==0:
        ans += 1
print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(b)
print(c)
print(a)
# Judge status: Accepted
D, T, S = map(int, input().split())
if -(-D//S) <= T:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

# C - Peaks
import copy

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

obs = copy.copy(h)

for i in range(m):
	a, b = map(int, input().split())
	a -= 1
	b -= 1
	
	height = max(obs[a], obs[b])
	obs[a] = height
	obs[b] = height
	#print(obs)

ans = 0

for i in range(n):
	if obs[i] == h[i]:
		ans += 1

print(ans)
# Judge status: Wrong Answer
from functools import reduce
from fractions import gcd
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
x = reduce(gcd,T)
sum=x
for i in T:
    sum*=(i//x)
print(sum)
# Judge status: Accepted
l = list(map(int, input().split()))
ans = 0
while( l[0]%2==0 and l[1]%2==0 and l[2]%2==0):
    if l[0]==l[1]and l[1]==l[2]:
        ans = -1
        break
    else:
        a = l[0]
        b = l[1]
        c = l[2]
        l[0]=(b+c)/2
        l[1]=(a+c)/2
        l[2]=(a+b)/2
        ans+=1
print(ans)
# Judge status: Accepted
n,k = map(int, input().split())
a = list(map(int, input().split()))


a.sort()

if k==0:
    print(max(a))
    exit()

def solve(num):
    ret=0
    for tmp in a:
        ret+= tmp//num
        if tmp%num==0:
            ret-=1
    return k>=ret

l=0
r=10**18
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid

print(min(max(a),r))
#print(min(min(a),r))
# Judge status: Accepted
N=int(input())
*L,=map(int, input().split())
L.sort()

ans=0
from bisect import bisect_right
for i in range(N-1,-1,-1):
    li = L[i]
    for j in range(i-1,-1,-1):
        lj = L[j]
        k = bisect_right(L, li-lj)
        ans += max(0, j-k)
print(ans)
# Judge status: Accepted
N = int(input())
A = []
B = []
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()

if N%2:
    ma = A[N//2]
    mb = B[N//2]
    print(max(0, mb - ma + 1))
else:
    ma = A[N//2] + A[N//2-1]
    mb = B[N//2] + B[N//2-1]
    print(max(0, mb - ma + 1))
# Judge status: Accepted
n=int(input())
a,b,c=map(int,input().split())
for _ in range(1,n):
    aa,bb,cc=map(int,input().split())
    a,b,c=aa+max(b,c),bb+max(a,c),cc+max(a,b)
print(max(a,b,c))
# Judge status: Accepted
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

S = list(input())
T = list(input())

N = len(S)
for i in range(N): #スタート位置
    flag = True
    for j in range(N):
        if S[(i + j) % N] == T[j]:
            continue
        flag = False
        break
    if flag:
        print ('Yes')
        exit()

print ('No')
# Judge status: Accepted
a,b,c = map(int,input().split())

if c-a-b < 0:
    print('No')
    exit()

if (c-a-b)**2 - 4*a*b > 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
K, A, B = map(int, input().split())

if B <= A + 2:
    print(1 + K)
else:
    ans = (K - (A - 1)) // 2 * (B - A) + A
    if (K - (A - 1)) % 2 == 1:
        ans += 1
    print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
s, _, *q = open(0)
g = ""
s = s.strip()
for q in q:
  q = q.strip().split()
  if q[0] == "1":
    g, s = s, g
  else:
    if q[1] == "1":
      g += q[2]
    else:
      s += q[2]
print(g[::-1] + s)
# Judge status: Wrong Answer
try:
  N, x = map(int, input().split())
  a = list(map(int, input().split()))
  a_ = sorted(a)
  cnt = 0
  for i in a_:
      if i<=x:
          cnt += 1
          x = x-i
  print(cnt)
except EOFError:
  pass
# Judge status: Accepted
S = str(input())
S += '/'
l = [0]*len(S)

for i in range(len(S)-1):
  if S[i] == '<':
    l[i+1] = l[i] + 1
for i in range(len(S)-2,-1,-1):
  if S[i] == '>':
    l[i] = max(l[i+1]+1,l[i])

print(sum(l))
# Judge status: Wrong Answer
def main():
    n, m = map(int,(input().split()))
    if n <= 2 and m <= 2:
        print(0)
    elif n>2 and m>2:
        print((n-2)*(m-2))
    elif n>2:
        if m == 2:
            print(0)
        else:
            print(n-2)
    elif m>2:
        if n == 2:
            print(0)
        else:
            print(m-2)

    

        


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


def main():
    ss = input()
    ts = input()
    n = len(ss)

    for i in range(n):
        ss = ss[-1] + ss[:-1]
        if ss == ts:
            print('Yes')
            sys.exit(0)

    print("No")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if(e-a <= k):
    print("Yey!")
else:
    print(":(")
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b+1)):
  ans.append(i)
for i in range(max(b-k+1,a),b+1):
  ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
  print(i)
# Judge status: Accepted
N,T=map(int,input().split())
CL = []
for i in range(N):
  c, ti = map(int,input().split())
  if ti <= T:
    CL.append(c)
if len(CL) == 0:
  print("TLE")
else:
  CL.sort()
  print(CL[0])
# Judge status: Accepted
from collections import deque, Counter, defaultdict
from itertools import chain, combinations
import json
# import numpy as np
import bisect
import sys
import math
import bisect
from functools import lru_cache
import itertools

sys.setrecursionlimit(10 ** 8)

M = 10 ** 9 + 7
INF = 10 ** 17


def main():
    N = int(input())
    # D = [
    #     [int(a) for a in input().split()]
    #     for _ in range(N)
    # ]

    t = 0
    for a in range(1, N):
        d = (N-1) // a
        t += d
    print(t)


if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
    X, A, B = map(int, input().split())
    if A - B >= 0:
        print('delicious')
    elif X >= (B - A):
        print('safe')
    else:
        print('dangerous') 
main()
# Judge status: Accepted
N,M,K = map(int,input().split())
for a in range(N+1):
    for b in range(M+1):
        k = a*b + (N-a)*(M-b)
        if k==K:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    ans = max(ans,sum(a[:i+1])+sum(b[i:]))
print(ans)
# Judge status: Accepted
x,y = map(int,input().split())
if x % y:
    print(x)
else:
    print(-1)
# Judge status: Accepted
rating = int(input())
if rating < 600:
    print(8)
elif rating < 800:
    print(7)
elif rating < 1000:
    print(6)
elif rating < 1200:
    print(5)
elif rating < 1400:
    print(4)
elif rating < 1600:
    print(3)
elif rating < 1800:
    print(2)
else:
    print(1)
# Judge status: Accepted
N,M = list(map(int, input().split()))
Hs = list(map(int, input().split()))

is_good = [True] * N

for i in range(M):
    a,b = list(map(int, input().split()))

    if Hs[a-1] == Hs[b-1]:
        is_good[a-1] = False
        is_good[b-1] = False
    elif Hs[a-1] < Hs[b-1]:
        is_good[a-1] = False
    else:
        is_good[b-1] = False

cnt = 0 
for v in is_good:
    if v:
        cnt += 1

print(cnt)
# Judge status: Accepted
n, k, q = map(int, input().split())
l = [k-q for i in range(n)]
for i in range(q):
  a = int(input()) - 1
  l[a] += 1
for i in range(n):
  if l[i] > 0:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
N,Y=map(int,input().split())
for i in range(N+1):
    for m in range(N+1-i):
        y=N-i-m
        if Y==i*10000+m*5000+y*1000:
            print(i,m,y)
            exit()
print(-1,-1,-1)
# Judge status: Accepted
s,t = input().split()
a,b = map(int,input().split())
u = input()

if u==s:
    print(a-1,b)
else:
    print(a,b-1)
# Judge status: Accepted

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    for i in range(N):
        A[i] = A[i] % 4
        if A[i] == 3:
            A[i] = 1
    if A.count(2):
        if A.count(1) + 1 - A.count(0) <= 1:
            print('Yes')
        else:
            print('No')
    else:
        if A.count(1) - A.count(0) <= 1:
            print('Yes')
        else:
            print('No')


resolve()
# Judge status: Wrong Answer
from collections import Counter
def main():
    n = int(input())
    a = list(map(int,input().split()))
    a.sort(reverse=True)
    ac = Counter(a)
    i1 = 0
    i2 = 0
    for eac in ac:
        if ac[eac] >= 2:
            if i1 == 0:
                i1 = eac
            elif i2 == 0:
                i2 = eac
    if i1 == 0 or i2 == 0:
        print(0)
    else:
        print(i1*i2)

if __name__ == '__main__':
    main()
# Judge status: Accepted
#coding utf-8

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

for i in range(1009):
  if A==int(i*0.08):
    if B==int(i*0.1):
      print(i)
      exit()
print(-1)
# Judge status: Wrong Answer
s = input()
t = input()

if s in t and s < t and len(s) <= 10:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
S = list(input())
 
S = ''.join([chr(abs(ord(s)+N-ord('Z'))+ord('A')) for s in S])
print(S)
# Judge status: Accepted
def f(N,M):
    return N*(N-1)//2+M*(M-1)//2
N,M=map(int,input().split())
print(f(N,M))
# Judge status: Accepted
def gcd(a,b):    #求最大公约数
    if b==0:
        return a
    else:
        return gcd(b,a%b)
n=int(input())
mod=1000000007
s=[int(j) for j in input().split()]
ans=1
for i in s:
    ans*=i//gcd(ans,i)
print(sum(ans//i for i in s)%mod)
# Judge status: Wrong Answer
n = int(input())
m = [int(i) for i in input().split()]
count = 0
ans = 0
for j in range(n-1):
    first = m[j]
    count = 0
    for k in range(j,n):
        if first >= m[k]:
            count +=1
        else:
            break
        first = m[k]
    ans = max(count,ans)
print(ans-1)
# Judge status: Wrong Answer
N = list(map(int,input().split()))
M = (N[2] - N[1]) * (N[0] - 2) + 1
if N[0] == 1:
    print(1)
elif N[1] == 2:
    print(1)
else:
    print(M)
# Judge status: Accepted
n = int(input())
a = [input() for _ in range(n)]
a0 = a[0]
for i in range(1,n):
    if a[i][0] == a0[-1]:
        flag = True
    else:
        flag = False
        break
    a0 = a[i]
if len(set(a)) == len(a) and flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from collections import defaultdict
n, m = map(int, input().split())
order = []
dd = defaultdict(int)

for i in range(m):
    p, y = map(int, input().split())
    order.append([i, p, y])

# 全体を年代順にソート
order.sort(key=lambda x: (x[2]))
# print(order)

ans = ['']*m
for ii, pp, yy in order:
    dd[pp] += 1
    ans[ii] = '{:0>6}{:0>6}'.format(pp, dd[pp])

print('\n'.join(ans))
# Judge status: Accepted
# coding: utf-8
import math
n=int(input())
A=[]
B=[]
for i in range(n):
    a, b = map(int,input().split())
    A.append(a)
    B.append(b)
cnt=0
for i in range(n-1,-1,-1):
    a=A[i]
    b=B[i]
    cnt += math.ceil((a+cnt)/b)*b-(a+cnt)
print(cnt)
# Judge status: Accepted
a,b = map(int,input().split())
x = int(2*a-1)
y = int(a+b)
z = int(2*b-1)
l = []
l.append(x)
l.append(y)
l.append(z)
print(max(l))
# Judge status: Wrong Answer
x, k, d = map(int, input().split())

x = abs(x)

if x>k*d:
    print(x-k*d)
else:
    a = x//d
    if (k-a)%2==0:
        print(x-a*d)
    else:
        print(abs(x-a*2*d))
# Judge status: Wrong Answer
a,b,c,k = map(int,input().split())
print((a-b)*(-1)**(k%2+1))
# Judge status: Accepted
a,b,c,k=map(int,open(0).read().split())
for i in' '*k:
 if a>=b:b*=2
 elif b>=c:c*=2
print('NYoe s'[a<b<c::2])
# Judge status: Accepted
n = int(input())
c = input()

r_num = c.count("R")

for i in range(n):
    if c[i] == "W":
        break

print(max(c[i:].count("R")-c[i:r_num].count("R"), 0))
# Judge status: Accepted
n=int(input())
a=[0]*10001
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      v=i**2+j**2+k**2+i*j+j*k+k*i
      if v<10001:
        a[v]+=1
for m in range(n):
  print(a[m+1])
# Judge status: Wrong Answer
print('A%sC'%'BR'[id(id)%9%2])
# Judge status: Accepted
D = int(input())
 
if D == 25:
	print("Christmas")
elif D == 24:
	print("Christmas Eve")
elif D == 23:
	print("Christmas Eve Eve")
elif D == 22:
	print("Christmas Eve Eve Eve")
# Judge status: Accepted
N, K, Q = map(int, input().split())
arr = [0] * N
for i in range(Q):
  q = int(input())
  arr[q-1] += 1
for i in range(N):
  if K - Q + arr[i] > 0:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
def factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
x = int(input())
for i in range(x,x+10000):
    if len(factorize(i)) == 1:
        print(i)
        break
# Judge status: Accepted
X,N=map(int,input().split())
p=list(map(int,input().split()))

ans=0
for i in range(100):
  if X-i not in p:
    ans=X-i
    break
  elif X+i not in p:
    ans=X+i
    break

print(ans)
# Judge status: Accepted
a,b = map(int, input().split())
print(a*b)
# Judge status: Wrong Answer
import sys
readline=sys.stdin.readline
 
N=int(readline())
A = [None] * N
B = [None] * N
for i in range(N):
  A[i],B[i] = map(int,readline().split())

A = sorted(A)
B = sorted(B)

if N % 2 == 1:
  minval = A[N // 2]
  maxval = B[N // 2]
  print(max(maxval - minval + 1,0))
else:
  minval = A[(N - 1) // 2]
  maxval = B[(N) // 2]
  ran = maxval - minval + 1
  print((ran * (ran - 1)) // 2)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
ans = 1
flag = True

for i in range(n):
	ans *= a[i]
	if ans > 1000000000000000000:
		flag = False
		break;
if flag == True:
	print(ans)
else:
	print(-1)
# Judge status: Accepted
N = input()
K = len(N)
c = N[0]
a = 0
for i in range(1,K):
  if N[i] != "9":
    a = 1
if a == 0:
  print(int(c) + 9*(K-1))
else:
  print(int(c) + 9*(K-1)-1)
# Judge status: Wrong Answer
S = {}
S['a'] = input()
S['b'] = input()
S['c'] = input()


next = 'a'
lens = {'a':len(S['a']), 'b':len(S['b']), 'c':len(S['c'])}
counts = {'a':0, 'b':0, 'c':0}

while True:
  now = next
  if counts[now] == lens[now]:
    print(now)
    exit()
  next = S[now][counts[now]]
  counts[now] += 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")
    exit()

print("No")
# Judge status: Accepted
n,m = map(int,input().split())
if n == m:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math

n = int(input())

bi_factors = []

for i in range(1,int(math.sqrt(n)+1)):
    if n%i == 0:
        temp = (i,n//i)
        bi_factors.append(temp)

inf = float('INF')
ans = inf

for point in bi_factors:
    d = point[0] + point[1] - 2
    if ans > d:
        ans = d

print(ans)
# Judge status: Accepted
n = int(input())
ansl = []
if n == 0:
	print(0)
	exit()
while n != 0:
	if n % 2 == 1:
		ansl.append("1")
		n -= 1
	else:
		ansl.append("0")
	n //= -2
print("".join(ansl)[::-1])
# Judge status: Accepted
n, c, k= map(int, input().split())
T = [int(input()) for _ in range(n)]
T.sort()

bus_t = -k - 100
bus_c = c
ans = 0

for t in T:
    bl = (bus_t + k >= t) and (bus_c + 1 <= c)
    if bl:
        bus_c += 1
        continue
    ans += 1
    bus_t = t
    bus_c = 1
print(ans)
# Judge status: Accepted
N = int(input())
list = list(range(1,10))
ans = 0
for i in list:
    for k in list:
        if i*k == N:
            ans = 1
print('Yes' if ans == 1 else 'No')
# Judge status: Accepted
N = int(input())
dic = dict()
for i in range(N):
  dic[input()] = 1
print(len(dic))
# Judge status: Accepted
k,s=map(int,input().split())
print(len([1 for x in range(k+1) for y in range(k+1) if 0<=s-x-y<=k]))
# Judge status: Accepted

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

score = [0]*n
for i in range(n-2,-1,-1):
    if h[i] >= h[i+1]:
        score[i] = score[i+1] + 1
 
print(max(score))
# Judge status: Accepted
from collections import Counter
n = int(input())
s = input()
c = Counter(s)
for i in range(n-1):
    s = input()
    s = Counter(s)
    for i in s:
        if c[i]:
            c[i] = min(c[i],s[i])
    for i in c:
        if not s[i]:
            c[i] = 0
ans = ''
for i in c:
    ans += i*c[i]
print(''.join(sorted(ans)))
# Judge status: Accepted
import heapq
n,m = map(int,input().split())
dp = [0]*(n+1)
L = []
days = []
cost = []
for i in range(n):
    a,b = map(int,input().split())
    if a > m:
        continue
    L.append([a,b])

L.sort(reverse = True)

ans = 0
li = []
for i in range(1,m+1):
    while L and L[-1][0] <= i:
        (a,b) = L.pop()
        heapq.heappush(li,b*(-1))

    if li:
        h = heapq.heappop(li)
        ans +=(-1)*h

print(ans)