peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, m = map(int, input().split())

gu = 1
ki = m - m%2 + 2

for i in range(1, m+1)[::-1]:
    if i % 2 == 0:
        print(gu, gu+i)
        gu += 1
    else:
        print(ki, ki+i)
        ki += 1
# Judge status: Wrong Answer
n = int(input())

def aa(nokori, str, nowID, firstID):
  if nokori == 1:
    print(str+chr(nowID))
    return
  for i in range(nowID - firstID + 2):
    aa(nokori-1, str+chr(nowID), firstID + i, firstID)
 
aa(n, "", 97, 97)
# Judge status: Accepted
from heapq import heappush, heappop
n,m=map(int,input().split())
data=[]
pn=[0 for _ in range(n)]
for i in range(m):
  p,y=map(int,input().split())
  heappush(data,(y,p,i))
data2=[]
while data:
  y,p,i=heappop(data)
  pn[p-1]+=1
  cid=str(p).zfill(6)+str(pn[p-1]).zfill(6)
  data2.append((i,cid))
for i,cid in sorted(data2):
  print(cid)
# Judge status: Accepted
n, a, b = map(int, input().split())
s = input()
cnt = 1
memo = 1
for i in range(n):
  if s[i] == 'c':
    print('No')
  else:
    if cnt <= a + b:
      if s[i] == 'b' and memo <= b:
        memo += 1
        cnt += 1
        print('Yes')
      elif s[i] == 'a':
        cnt += 1
        print('Yes')
      else:
        print('No')   
    else:
      print('No')
# Judge status: Accepted
S=input()

ans=0
tmp=0
for i in range(len(S)):
    if S[i] in ("A","C","G","T"):
        tmp+=1
    else:
        ans=max(ans,tmp)
        tmp=0
ans=max(ans,tmp)
print(ans)
# Judge status: Wrong Answer
S = list(map(str, input()))
S[3] = "7"

for s in S:
  print(s, end = "")
# Judge status: Wrong Answer
N=int(input())
L=list(map(int,input().split()))
L=sorted(L)
s=(L[0]+L[1])/2
for i in range(2,N):
  s=(s+L[i])//2
print(s)
# Judge status: Accepted
a,b = map(int,input().split())
cnt = 1
c = b-a
if c >0:
    cnt += (c//(a-1))
    d = c%(a-1)
    if d != 0:
        cnt += 1
if b == 1:
    cnt = 0
print(cnt)
# Judge status: Accepted
n,d=map(int,input().split())
x=[]

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

cnt=0

i=0
while i<n-1:
    j=i+1
    while j<n:
        temp=0
        for k in range(d):
            temp+=(x[i][k]-x[j][k])**2
        if temp==int(temp**(1/2))*int(temp**(1/2)):
            cnt+=1
        
        j+=1
    i+=1    

print(cnt)
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    A, B, C = map(int, input().split())

    diff_1 = A * B * (C % 2)
    diff_2 = A * (B % 2) * C
    diff_3 = (A % 2) * B * C
    
    ans = min(diff_1, diff_2, diff_3)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
dic = {}
for i in range(N):
    data = A[i]
    if data in dic:  dic[data] += 1
    else:  dic[data] = 1
ans = 0
for i in dic:
    if dic[i] % 2:  ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
S = list(map(int, input().split()))
cnt = 1
for i in range(N):
    if S[i] == cnt:
        cnt += 1
if cnt == 1:
    print(-1)
else:
    print(N - cnt + 1)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = ['S'] + list(input())

for i in range(2, max(c, d)):
    if s[i] == '#' and s[i-1] == '#':
        print('No')
        exit()

if c < d:
    print('Yes')
else:
    for i in range(b, d+1):
        if s[i-1] == '.' and s[i] == '.' and s[i+1] == '.':
            print('Yes')
            exit()
    print('No')
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
ans = 100
def colsum(s):
    ret = 0
    for i in s:
        ret += int(i)
    return ret

for i in range(1,n):
    cand = colsum(str(i))+colsum(str(n-i))
    ans = min(cand,ans)
print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

for i in range(2000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        quit()

print(-1)
# Judge status: Accepted
a, b, n = map(int, input().split())
x = min(b-1, n)
ans = (a * x // b) 
print(ans)
# Judge status: Accepted
n=int(input())
a=[]
b=[]
for i in range(n):
  c,d=map(int,input().split())
  a.append(c)
  b.append(d)
a=sorted(a)
b=sorted(b)
if n%2==0:
  x=(a[n//2-1]+a[n//2])
  y=(b[n//2-1]+b[n//2])
  print(y-x+1)
else:
  print(b[n//2]-a[n//2]+1)
# Judge status: Accepted
a, b = map(int, input().split())

ans = -1
for v in range((100*10)+100):
  t8 = int(v * 0.08)
  t10 = int(v * 0.1)

  if t8 > a or t10 > b:
    break

  if t8 == a and t10 == b:
    ans = v
    break

print(ans)
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    if a >= 10 or b >= 10:
        print(-1)
    else:
        print(a*b)
    
main()
# Judge status: Accepted
N = input()

if "9" in N:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
S=input()
s=""
m=""
ss=[]
mm=[]
s1=set()
m1=set()
res = 0
for i in range(N):
  s=S[0:i]
  m=S[i+1:N]
  ss=list(s)
  mm=list(m)
  s1=set(ss)
  m1=set(mm)
  s_intersection = s1 & m1
  res= max(res,len(s_intersection))
print(res)
# Judge status: Wrong Answer
N,M = map(int,input().split())
n = M // N
import math
m = math.ceil(M**0.5)
for i in range(min(n,m)):
    x = n - i
    if M % x == 0:
        print(x)
        quit()
# Judge status: Accepted
n = int(input())
s = {}
count = 0
while n > count:
    st = input()
    if st not in s:
        s[st] = 1
        count += 1
    else:
        s[st] += 1
        count += 1

sorteditems = sorted(s.items(), key = lambda x : x[1], reverse= True)
max = 0
ans = []
for a, b in sorteditems:
    if max == 0:
        ans.append(a)
        max = b
    elif max == b:
        ans.append(a)
for i in sorted(ans):
    print(i)
# Judge status: Accepted
N=int(input())
A=int(input())
if N % 500 <= A:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
from collections import Counter as co
g=list(map(int,input().split()))
l=co(g)
f=sum(g)
q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    if b in l:
        v=l[b]
        l[b]=0
        l[c]+=v
        f=f-v*b+c*v
    print(f)
# Judge status: Accepted
import fractions
N = int(input())
A = list(map(int, input().split()))
right = [A[0]]*N
left = [A[-1]]*N
for i in range(1,N):
    right[i] = fractions.gcd(right[i-1],A[i])
    left[N-1-i] = fractions.gcd(left[N-i],A[N-1-i])
ans = left[1]
for i in range(N-2):
    ans = max(ans,fractions.gcd(right[i],left[i+2]))
print(max(ans,right[N-2]))
# Judge status: Wrong Answer
import math
n = int(input())
if n%2==1:
    print(0)
else:
    c = n//10
    i = 1
    while 10*5**i<n:
        c += n//(10*5**i)
        i+=1
    print(c)
# Judge status: Wrong Answer

H,W = map(int,input().split())

if H % 2 == 0:
    t = H // 2
    u = H // 2
else:
    t = H // 2 + 1
    u = H // 2

if W % 2 == 0:
    print ((t+u) * (W//2))
else:
    print (t * (W//2+1) + u * (W//2))
# Judge status: Accepted
from math import floor
from decimal import Decimal

AB = input().split()
A = Decimal(AB[0])
B = Decimal(AB[1])

c = floor(A * B)
print(c)
# Judge status: Accepted
west=124
east=-1
for _ in range(5):
    x=int(input())
    west=min(x,west)
    east=max(x,east)
k=int(input())
if east-west>k:
    print(":(")
else:
    print("Yay!")
# Judge status: Accepted
A, B, X = map(int, input().split())
r = X - A

if r <= B and r >= 0:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
import math
x = int(input())
for i in range(x,0,-1):
    if math.sqrt(i)%1 == 0  or (math.ceil(i ** (1/3)))**3 == i:
        print(i)
        break
# Judge status: Wrong Answer
n = int(input())
s = input()
l_cnt = 0
r_cnt = 0
for i in s:
    if i == '(':
        l_cnt += 1
    else:
        r_cnt += 1

if l_cnt == r_cnt:
    print(s)
    
if l_cnt < r_cnt:
    print('('*(r_cnt - l_cnt) +s)
    
if l_cnt > r_cnt:
    print(s +')'*(l_cnt - r_cnt))
# Judge status: Wrong Answer

KEY = "keyence"

def main():
    s = input()

    for i in range(1, len(KEY)):
        r = KEY[0:i]
        l = KEY[i:]

        if s.startswith(r) and s.endswith(l):
            print("YES")
            return

    print("No")

main()
# Judge status: Accepted
# coding: utf-8

import math
import re
import numpy as np
import copy

#読み込む
N = int(input())
an = list(map(int, input().split(' ')))
ans = 0

for i in range(N):
    if (i+1) % 2 == 0:
        continue
    elif an[i] % 2 != 0:
        ans += 1

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

keep = 0
cnt =0
x=0


for a in A:
    if keep > a:
        cnt += keep -a
        x = keep -a
        print(x)
        keep = a + x
    else:
      keep = a
    
    
print(cnt)
# Judge status: Accepted
def main():
    N = int(input())
    G = [int(input()) for i in range(5)]
    G = [(N+g-1)//g for g in G]
    print(max(G)+4)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = [int(i) for i in input().strip().split()]
    B = [int(i) for i in input().strip().split()]

    _diff_A, _diff_B = 0, 0

    for i in range(n):
        if A[i] > B[i]:
            _diff_A += A[i] - B[i]
        elif B[i] > A[i]:
            _diff_B += B[i] - A[i]

    if _diff_B > _diff_A * 2:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [-1 * i for i in a]
heapq.heapify(a)
cnt = 0
while cnt < m:
    x = heapq.heappop(a) * -1
    x = x // 2
    cnt += 1
    heapq.heappush(a, x * -1)
print(sum(a) * -1)
# Judge status: Accepted
X = int(input())
# とりあえず 100 で構成しようとして、余剰分を 100 を置換することで構成できないか調べる
q, r = X//100, X%100
if r <= 5 * q:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
s=input()
ans=1
all="abcdefghijklmnopqrstuvwxyz"
for i in all:
    if i not in s:
        print(i)
        ans=0
if ans==1:
    print("None")
# Judge status: Accepted
import numpy as np
N = int(input())
AB = ['']*N
for i in range(N):
  AB[i] = list(map(int, input().split()))
#AB = np.array(AB)

AB = sorted(AB, key=lambda x: x[1])
#print(AB)
total = 0
flag = 1
for i in range(N):
  total += AB[i][0]
  if total > AB[i][1]:
    flag = 0
    break
if flag == 1:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s=input()
ans=1000
for i in range(len(s)-3):
  ans=min(ans,abs(753-int(s[i:i+3])))
print(ans)
# Judge status: Accepted
S = int(raw_input())

X1 = 0
Y1 = 0
X2 = 10**9
Y2 = 1

mod = 10**9

if S%mod == 0:
    X3 = 0
    Y3 = S/mod
else:
    Y3 = S/mod + 1
    X3 = mod - S%mod


print X1, Y1, X2, Y2, X3, Y3
# Judge status: Wrong Answer
n,m,k = [int(x) for x in input().split()]

ans = "No"
for i in range(n):
    for j in range(m):
        if i * (m-j) + j * (m-i) == k:
            ans = "Yes"
            break

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    a, b = map(int, input().split())
    if b < a:
        print(a - 1)
    else:
        print(a)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x,y,z = iim()
print(x//(z+y))
# Judge status: Wrong Answer
N,X,Y = map(int,input().split())
length = [0]*(N+1)
for i in range(1,N+1):
  for j in range(i,N+1):
    ans = min(abs(j-i),abs(X-i)+1+abs(Y-j),abs(X-j)+1+abs(Y-i))
    length[ans] += 1
for i in range(1,N+1):
  print(length[i])
# Judge status: Accepted
### 動的計画法
#ABC129C - Typical Stairs
#https://atcoder.jp/contests/abc129/tasks/abc129_c

mod = 10**9+7
n, m = list(map(int,input().split()))
a = [int(input()) for _ in range(m)]
dp = [float("Inf")]*(n+1)
for i in range(m):
    dp[a[i]] = 0
dp[0] = 1
if dp[1] == float("Inf"):
    dp[1] = 1
for i in range(2,n+1):
    if dp[i] == float("Inf"):
        dp[i] = dp[i-1] + dp[i-2]
print(dp[n]%mod)
# Judge status: Accepted
n,t=map(int,input().split())
ans=1000000
for i in range(n):
  x,y=map(int,input().split())
  if y<=t:
    ans=min(ans,x)
if ans<=100000:
  print(ans)
else:
  print("TLE")
# Judge status: Accepted
n = int(input())
l = [2,1]
if n==1:
    print(l[1])
else:
    c = 2
    while(c<=n):
        l.append(sum(l[-2:]))
        c+=1
    print(l[-1])
# Judge status: Accepted
a, b, k = map(int, input().split())

num = min(a, b)

cnt = 0

while cnt < k:
    if a%num == 0 and b%num == 0:
        cnt += 1
        num -= 1
    else:
        num -= 1
print(num + 1)
# Judge status: Accepted
X,Y = map(int,input().split())
ans = []
ans.append(X)

while max(ans)*2 <= Y:
    ans.append(max(ans)*2)
print(len(ans))
# Judge status: Accepted
import math

L, R, d = map(int, input().split())

l = math.ceil(L / d)
r = math.floor(R / d)

print(r - l + 1)
# Judge status: Accepted
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

N = int(input())

def solve():
    cnt = 0
    for i in range(1, N):
        cnt += (N-1)//i
    print(cnt)
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
a,b=map(int,input().split())
s=input()
flag=True
for i in range(0,a+b+1):
  if i<a and not s[i].isdecimal():
    flag=False
    break
  elif i==a and not s[i]=="-":
    flag=False
    break
  elif a<i and not s[i].isdecimal():
    flag=False
    break
if flag:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b=map(int,input().split())
if min(a,b)==1:
  if a==1 and b==1:
    print(1)
  else:
    print(max(a,b)-2)
else:
  print((a-2)*(b-2))
# Judge status: Wrong Answer
i=int(input())
x=20*i
y=(i//15)*200
print(x-y)
# Judge status: Wrong Answer
n,k = map(int,input().split())

def gcd(a,b):
    b,a = sorted([a,b])
    while(b!=0):
        save = b
        b = a%b
        a = save
    return a


if(n%k==0):
    print(0)
else:
    print(gcd(n,k))
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
seta=set(a)
ca=dict(Counter(a))
a=[k for k,v in ca.items() if v==1]
if len(a)==0:
  print(0)
  exit()
a.sort()
maxa=a[-1]
for ai in a:
  i=2
  while maxa>=i*ai:
    seta.discard(i*ai)
    i+=1
print(len(seta))
# Judge status: Wrong Answer
X=list(map(int,input().split()))
for x in enumerate(X):
    if x[1]==0:
        print(x[0])
        break
# Judge status: Wrong Answer

def main():
    n,m = map(int,input().split())
    ab = [[0] * n for i in range(n)]
    for _ in range(m):
        a,b = map(int,input().split())
        ab[a-1][b-1] = 1

    for mid in range(1,n):
        if ab[0][mid] == 1 and ab[mid][n-1] == 1:
            return
    print('IMPOSSIBLE')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n==1 or m==1:
    print(max(0,max(n,m)-2))
else:
    print((n-2)*(m-2))
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
t = sum(B)
j = M
for i in range(N+1):
    while j > 0 and t > K:
        j -= 1
        t -= B[j]
    if t > K:
        break
    ans = max(ans, i+j)
    if i == N:
        break
    t += A[i]
print(ans)
# Judge status: Wrong Answer
n,m=[int(i) for i in input().split()]
s=['*']*n
flag=0
for i in range(m):
    a,b=[int(i) for i in input().split()]
    if(s[a-1]=='*'):
        s[a-1]=str(b)
    else:
        if(s[a-1]!=str(b)):
            flag=1
for i in range(0,len(s)):
    if(s[i]=='*'):
        s[i]='0'
e=''
for i in range(0,len(s)):
    e=e+s[i]
e=int(e)
if(len(str(e))!=n or flag==1):
    print(-1)
else:
    print(e)
# Judge status: Wrong Answer
w = list(map(str,input()))

w_ord = []

for i in range(len(w)):
    w_ord.append(ord(w[i]))

w_ord.sort()

j = 1

if len(w) % 2 == 1:
    print("NO")
else:
    for i in range((len(w)+1)//2):
        if not w_ord[2*i] == w_ord[2*i + 1]:
            print("NO")
            break
        else:
            if i == (len(w)+1)//2 -1:
                print("YES")
# Judge status: Accepted
import numpy as np

def calculate_num_boss(num_person, boss):
    boss_count = np.zeros([num_person])
    result, num = np.unique(boss, return_counts=True)
    for idx in range(result.shape[0]):
        ids = result[idx]
        boss_count[ids-1] = num[idx]

    return boss_count


if __name__ == "__main__":
    num_person = int(input().split()[0])
    bosses = np.array([int(i) for i in input().split()])
    count = calculate_num_boss(num_person, bosses)
    for i in count:
        print(int(i))
# Judge status: Accepted
from itertools import accumulate
n = int(input())
s = list(input())
l = [1 if s[i] == "E" else 0 for i in range(n)]
l = list(accumulate(l))
ans = l[-1]-l[0]
for i in range(1, n):
    ans = min(ans, i-l[i-1] + l[-1]-l[i])
print(ans)
# Judge status: Accepted
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]

ans = t[0]
for i in range(1,n):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
cnt4,cnt2=0,0
for i in a:
    if i % 4 == 0:
        cnt4 += 1
    elif i % 2 == 0:
        cnt2 += 1

cnt2 = max(1,cnt2)
print('Yes' if 2 * cnt4 + cnt2 == n else 'No')
# Judge status: Accepted
from math import floor
from decimal import Decimal
A,B=input().split()
A=int(A)
B=Decimal(B)
print(int(A*B))
# Judge status: Accepted
x = int(input())
isPrime = False


def isP(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True


isPrime = isP(x)

if isPrime:
    print(x)
else:
    while isPrime == False:
        x += 1
        isPrime = isP(x)
    print(x)
# Judge status: Accepted
from collections import deque

K = int(input())

lunlun = deque()

for i in range(1, 10):
    lunlun.append(i)

for i in range(K - 1):
    x = lunlun[0]
    lunlun.popleft()
    if x % 10 != 0:
        res = 10 * x + x % 10 - 1
        lunlun.append(res)
        
    res = 10 * x + x % 10
    lunlun.append(res)

    if x % 10 != 9:
        res = 10 * x + x % 10 + 1
        lunlun.append(res)
    

print(lunlun[0])
# Judge status: Wrong Answer
n = list(input())
n = set(n)
if len(n) <= 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import itertools
import math
N = int(input())
ls = []
ans = 0
for i in range(N):
  x,y = map(int,input().split())
  ls.append([x,y])
ls2 = []
for i in itertools.permutations(ls,N):
  ls2.append(list(i))
for i in range(math.factorial(N)):
  ls3 = ls2[i]
  now_x = ls3[0][0]
  now_y = ls3[0][1]
  for j in range(1,N):
    ans += ((now_x - ls3[j][0])**2 + (now_y - ls3[j][1]) ** 2)**0.5
    now_x = ls3[j][0]
    now_y = ls3[j][1]
print(ans/math.factorial(N))
# Judge status: Accepted
N = int(input()) 
V = list(map(int, input().split()))
V = sorted(V)
ans = (V[0]+V[1])/2

for i in range(2,N):
    ans = (ans + V[i])/2
print(ans)
# Judge status: Wrong Answer
N = int(input())
l = [int(x) for x in input().split()]
cost = 1000000000000
for i in range(0,7):
  co = 0
  for j in range(N):
    co += (i - l[j]) ** 2
  if cost > co:
    cost = co
print(cost)
# Judge status: Accepted

S = input()
num_0 = S.count("0")
num_1 = S.count("1")
print(2 * min(num_0, num_1))
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 12:29:30 2020

@author: shinba
"""

a,b = map(int,input().split())

if a % 3 == 0:
    print("Possible")
elif b % 3 == 0:
    print("Possible")
elif (a+b) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Accepted
S=input()
T=input()
N=len(S)
s=list(S)
t=list(T)
count=0

for i in range(N):
    if s[i]!=t[i]:
        count+=1
print(count)
# Judge status: Accepted
N,M=map(int,input().split())
MOD=10**9+7

if abs(N-M)>1:
    print(0)
    exit()

fn=1
for n in range(2,min(N,M)+1):
    fn=fn*n%MOD
fx=fn

ans=1
if N==M:
    ans*=2
else:
    fx=fx*max(N,M)%MOD
print(ans*fn*fx%MOD)
# Judge status: Accepted
a = input().split()
for i in range(2):
    a[i] = int(a[i]) if i == 0 else round(float(a[i])*100)
print(int(a[0] * a[1] // 100))
# Judge status: Accepted
A, B, K = map(int, input().split())
if A >= K:
  A = A - K
elif A < K:
  B = B - (K - A)
  A = 0
 
print('{} {}'.format(A, max(0, B)))
# Judge status: Accepted
S = input()
print('ABC' if S == 'ARC' else 'ARC')
# Judge status: Accepted
a,b=map(int,input().split())
s=input()

tmp1=s[:a]
tmp2=s[a]
tmp3=s[a+1:]

if all([tmp1[i]!='-' for i in range(len(tmp1))])==True and tmp2=='-' and all([tmp3[i]!='-' for i in range(len(tmp3))])==True:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = input()
MOD =2019
count = [0]*MOD
r = 0
t = 1
for i in reversed(S):
    r += int(i) * t
    r %= MOD
    t *= 10
    t %= MOD
    count[r] += 1

count[0] += 1
print(int(sum(i*(i-1)/2 for i in count)))
# Judge status: Accepted
def divisors(n):
    res = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            res.append(i)
            if i != n // i:
                res.append(n // i)
    return res

n, m = map(int, input().split())
ans = 0
nums = divisors(m)
nums.sort()
num = nums.pop(0)
while num * n <= m:
    if (m - num * n) % num == 0:
        ans = num
    if nums == []:
        break
    num = nums.pop(0)
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
if a <= b * c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N, K = map(int, input().split())
ans = 0

for i in range(1, N + 1):
    tmp = 1 / N
    now = i
    while now < K:
        tmp *= 0.5
        now *= 2
    ans += tmp
    
print(ans)
# Judge status: Accepted
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    L = [INT() for _ in range(5)]
    k = INT()

    print("Yay!" if L[4] - L[0] <= k else ":(")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())

A = [0] * N
for i in range(N):
    A[i] = int(input())

ans = 1
cur_min = A[0]
for i in range(1, N):
    if A[i] > A[i-1]:
        continue
    else:
        if A[i] <= cur_min:
            ans += 1
            cur_min = A[i]

print(ans)
# Judge status: Accepted
a = int(input())
x = a + a**2 + a**3
print(int(x))
# Judge status: Wrong Answer
s = input()
ans = 0
while ('01'or'10') in s:
    ans += s.count('01')*2
    s = s.replace("01", "")
    ans += s.count('10')*2
    s = s.replace("10", "")
print(ans)
# Judge status: Accepted
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N, K = map(int, input().split())

print(0 if N % K == 0 else 1)
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
print("Yes" if a+b >= x >= a else "No")
# Judge status: Accepted
a,b,c = sorted(list(map(int,input().split())))
k = int(input())
for i in range(k):
  c *= 2
print(a+b+c)
# Judge status: Accepted
N = int(input())
robot = {}

for i in range(N):
  x, l = map(int, input().split())
  robot[x] = l

s_robot = sorted(robot.items(), key=lambda x:x[0])

pre_arm = -10**10
cnt = 0
for key, val in s_robot:
  l_arm = key - val
  r_arm = key + val
  if pre_arm > l_arm:
    cnt += 1
    if pre_arm > r_arm:
      pre_arm = r_arm
  else:
    pre_arm = r_arm
    
print(N-cnt)
# Judge status: Wrong Answer
A,B,C,X,Y=map(int,input().split())
if A+B<=C*2:
  print(A*X+B*Y)
elif max(A,B)<=2*C:
  if X>=Y:
    print(Y*2*C+(X-Y)*A)
  else:
    print(X*2*C+(Y-X)*B)
else:
  print(2*max(X,Y)*C)
# Judge status: Accepted
n = int(input())

s = {}
for _ in range(n):
    x = input()
    if x in s: s[x] += 1
    else: s[x] = 1

m = int(input())
t = {}
for _ in range(m):
    x = input()
    if x in t: t[x] += 1
    else: t[x] = 1

ans = 0
for k,v in s.items():
    ans = max(ans, v - (t[k] if k in t else 0))
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
ab = abs(a-b)
bc = abs(b-c)
ca = abs(c-a)
if ca <= d or  ab<=d and bc<=d:
  print("Yes")
else:
  print("No")