peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    a,b = map(int,input().split())
    if a == 0 or b ==0 or (a<0 and b>0):
        print("Zero")
        exit()
    else:
        if a > 0 and b > 0:
            print("Positive")
        elif abs(a-b)%2!=0:
            print("Positive")
        else:
            print("Negative")

if __name__=="__main__":
    main()
# Judge status: Accepted
a=[599,799,999,1199,1399,1599,1799,1999]
x=int(input())
for i,val in enumerate(a):
    if x<=val:
        print(8-i)
        break
# Judge status: Accepted
N=int(input())
a=list(map(int,input().strip().split()))
b=list(map(int,input().strip().split()))

#累積和
A=[]
B=[]
suma=0
sumb=0
for n in range(N):
    suma+=a[n]
    A.append(suma)
for n in reversed(range(N)):
    sumb+=b[n]
    B.append(sumb)

MAX=0
for n in range(N):
    MAX=max(MAX,A[n]+B[N-n-1])
print(MAX)
# Judge status: Wrong Answer
from collections import defaultdict
S = input()
d = defaultdict(int)
for i in range(len(S)):
  d[S[i]] += 1
if max(d) == 1:
  print("yes")
else:
  print("no")
# Judge status: Wrong Answer
string=input()
for s in string:
    s='x'
print(string)
# Judge status: Accepted
a,b = map(int, input().split())
if a%b == 0:
  print(a//b)
else:
  c = a//b
  print(c+1)
# Judge status: Accepted
N = int(input())

print('ABC' if 1 <= N <= 999 else 'ABD')
# Judge status: Accepted
X=int(input())
x=0
ans=[]

if X == 1:
  print(X)
  exit()
else:
  # p
  for i in range(2, int(X**0.5)+1):
    n=1
    a=i
    # b
    while n < X : #超えたら中断
      n *= a
      ans.append(n)
    if n // a > x:
      x = (n//a)
      #print(ans)
print(max(i for i in ans if i <= X))
# Judge status: Accepted
#!/usr/bin/env python3
from itertools import*
n, k, *A = map(int, open(0).read().split())

def imos(l, r):
    B[l] += 1
    if r + 1 != n:
        B[r + 1] -= 1

for _ in [0] * min(k, 41):
    B = [0] * n
    for i, a in enumerate(A):
        imos(max(i - a, 0), min(i + a, n - 1))
    *A, = accumulate(B)
print(*A)
# Judge status: Accepted
n=int(input())
a=100
count=0
while a<n:
	a=a+a//100
	count+=1
print(count)
# Judge status: Accepted
n = int(input())
n = n-1
print(n*(n+1)//2)
# Judge status: Accepted
from decimal import Decimal
a,b = list(map(int,input().split()))
if a == 1 or b ==1:
    d =1
elif a*b%2==0 and a >1 and b >1:
    d = a*b/2
else:
    d = (a*b+1)/2
print(Decimal(d))
# Judge status: Wrong Answer
x = int(input())
HP = 0

if x < 5:
  print(0)

while x >= 500:
  x -= 500
  HP += 1000

while x >= 5:
  x -= 5
  HP += 5

print(HP)
# Judge status: Accepted
a, b = map(int, input().split())
n = 0
for i in range(a, b + 1):
  if str(i) == str(i)[::-1]:
    n += 1
print(n)
# Judge status: Accepted
import sys
def v():
    x=[x for x in sys.stdin.readline().split()]
    print(len(set(x)))
if __name__=='__main__':v()
# Judge status: Accepted
def main():
    h1, m1, h2, m2, k = map(int, input().split())
    x = 60 * h1 + m1
    y = 60 * h2 + m2 - k
    print(max(0, y - x))

if __name__ == '__main__':
    main()
# Judge status: Accepted
s=input()
leng=len(s)
a=s.index("A")+1
z=leng-list(reversed(s)).index("Z")+1
print(z-a)
# Judge status: Wrong Answer
#B - Mix Juice
import math
from itertools import combinations 
n,k=map(int,input().split())
ｌ=list(map(int,input().split()))
min1=min(list(combinations(l,k)))
sum1=int(math.fsum(min1))
print(sum1)
# Judge status: Wrong Answer
import math
N = int(input())
a = [chr(i) for i in range(97, 97+26)]
data = ''
count = 1
data = f'{data}{a[N % 26-1]}'
if int(N/26) == 0:
    print(data[0])
    exit(0)
for i in range(int(math.log(N, 26))):
    data = f'{a[round((N/26**count) % 26-1)]}{data}'
    N -= 26**count
    count += 1
print(data)
exit(0)
# Judge status: Accepted
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

M = 10**9+7
n = inp()
x = ip()

sm = sum(x)
sq = sm*sm
ans = 0
for i in x: ans += i*i
ans = (sq-ans)//2
print(ans%M)
# Judge status: Wrong Answer
input = input().split(' ')
a = int(input[0])
b = int(input[0])

N = a*b

if N%2==0:
    print('Even')
else:
    print('Odd')
# Judge status: Accepted
N = int(input())
d = list(map(int, input().split()))
d = sorted(d)
print(d[N//2] - d[N//2-1])
# Judge status: Wrong Answer
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
b = []
c = []

for i in range (m):
  B,C = map(int, input().split())
  b.append(B)
  c.append(C)

t = True
cnt = 0
c1 = sorted(c[:])

while t == True and cnt < len(c):
  cnt += 1
  large = c1 [-cnt]
  num = b[c.index(large)]
  if large > min(a):
    for i in a:
      if i < large and a.index(i)+1 <= num:
        a[a.index(i)] = large
      else:
        break
    a.sort()
  else:
     t = False

print(sum(a))
# Judge status: Accepted
a = int(input())
b  =int(input())
h = int(input())
 
print(int(((a+b)*h)/2))
# Judge status: Wrong Answer
n=int(input())
d=list(map(int,input().split()))
d.sort()
left=d[n//2-1]
right=d[n//2]
print(right-left+1)
# Judge status: Wrong Answer
S = input()
flg = True
for s in range(0,len(S)-1):
    if s%2 == 0 and S[s] == "L":
        flg = False
    elif s%2 != 0 and S[s] == "R":
        flg = False
    
if flg:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = list(map(int,input().split()))
cnt = 0

while n.count(n[0]) != len(n):
    n.sort()
    if n[0] == n[1]:
        n[0] += 1
        n[1] += 1
    else:
        n[0] += 2
    cnt += 1
print(cnt)
# Judge status: Accepted
s = input()

d = 1001001

for i in range(len(s) - 1):
    x = int(s[i : i + 3])
    tmp = abs(x - 753)
    if tmp < d:
        d = tmp

print(d)
# Judge status: Wrong Answer
N = int(input())
lst = list(map(int, input().split()))
avg = round(sum(lst) // N)

result = 0
for i in lst:
    result += (i - avg)**2

print(result)
# Judge status: Wrong Answer
N = int(input())

op_cnt = len(bin(abs(N)))-2

import numpy as np

two = [(-2)**i for i in reversed(range(op_cnt))]

for i in range(2 ** op_cnt):
    op = [0] * op_cnt  
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = 1 
    if sum(np.array(op)*two) == N:
        op = [str(i) for i in op]
        print("".join(op))
        break
# Judge status: Wrong Answer
from collections import Counter
n=int(input())
sc=Counter(list(map(int,input().split())))
sm=0
for k,v in sc.items():
  sm+=min(v,(k-v if k-v>=0 else 10**9+1)) 
print(sm)
# Judge status: Accepted
N = int(input())
sum = 0
for i in range(1,N+1):
  sum+=i*(1+N//i)*(N//i)/2
print(int(sum))
# Judge status: Wrong Answer
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, *H = map(int, read().split())
dp = [INF] * N
dp[0] = 0

for i in range(0, N-2):
    print(i)
    dp[i + 1] = min(dp[i + 1], dp[i] + abs(H[i] - H[i + 1]))
    dp[i + 2] = min(dp[i + 2], dp[i] + abs(H[i] - H[i + 2]))
print(*dp)
print(dp[N-1])
# Judge status: Accepted
arr = input()
l = len(arr)

ans_arr = [0] * (l+1)
for i in range(l):
    if arr[i] == '<':
        ans_arr[i+1] = ans_arr[i] + 1

for i in range(l-1, -1, -1):
    if arr[i] == '>':
        ans_arr[i] = max(ans_arr[i], ans_arr[i+1] + 1)

# print(ans_arr)
print(sum(ans_arr))
# Judge status: Accepted
S = int(input())

if S <= 10**9:
    ans = [0, 0, S, 0, 0, 1]
    print(*ans)
    exit()
else:
    if S == 10 ** 18:
        ans = [0, 0, 10 ** 9, 0, 0, 10 ** 9]
        print(*ans)
        exit()
    mod = S % (10 ** 9)
    syou = S // (10 ** 9)
    x3 = 10 ** 9 - mod
    y3 = syou + 1
    ans = [0, 0, 10 ** 9, 1, x3, y3]
    print(*ans)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()

d = Counter(readInts())

d = [i for i in sorted(d.items(), reverse=True) if i[1]>=2]

if len(d)==0:
	print(0)
	exit()
elif len(d)==1:
	if d[0][1]>=4:
		pass
	else:
		print(0)
		exit()
if d[0][1]>=4:
	print(int(d[0][0])**2)
else:
	print(int(d[0][0])*int(d[1][0]))
# Judge status: Wrong Answer
a , b = map(int, input().split())
if b <=a:
    print(b // a )
elif b > a and (b - 1)%(a - 1)== 0:
    print((b - 1)// (a - 1))
elif b > a and (b - 1)%(a - 1)!= 0:
    print((b - 1)//(a - 1)+ 1)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0
calc_x = 0

ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
ans=0
if 400<=n<=599:
	ans=8
if 600<=n<=799:
	ans=7
if 800<=n<=999:
	ans=6
if 1000<=n<=1199:
	ans=5
if 1200<=n<=1399:
	ans=4
if 1400<=n<=1599:
	ans=3
if 1600<=n<=1799:
	ans=2
if 1800<=n<=1999:
	ans=1
print(ans)
# Judge status: Accepted
import collections
a=input()
b=list(a)
b=collections.Counter(b)
c=0
d=0
for i in b:
	if b[i]%2!=0:
		c=c+1

if c==0:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
n,m,*a=map(int,open(0).read().split())
c=[bin(i)[::-1].index("1") for i in a]
if sum(c)!=c[0]*n:
    print(0)
    exit()
from fractions import *
b=a[0]
for i in a:
    b=(i*b)//gcd(i,b)
    if b>2*m:
        print(0)
        exit()
print((m-b//2)//b+1)
# Judge status: Accepted
l,r = map(int, input().split())
m = 2019
for i in range(l,min(r+1,l+2020)):
    for j in range(i+1, min(r+1,l+2020)):
        i %= 2019
        j %= 2019
        m = min(m, (i*j)%2019)
print(m%2019)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
s = sum(a)
data = [a[0]]
m = abs(a[0] - a[-1])

for i in range(1, N - 1):
    data.append(a[i] + data[i - 1])

for i in range(0, N - 1):
    if abs(s - 2 * data[i]) < m:
        m = abs(s - 2 * data[i])

print(m)
# Judge status: Accepted
s = set()
for _ in range(int(input())): s.add(input())
print(len(s))
# Judge status: Wrong Answer
N = int(input())

tprev = 0
xprev = 0
yprev = 0

result = 'YES'

for i in range(N):
    t, x, y = map(int, input().split())

    xlen = abs(x - xprev)
    ylen = abs(y - yprev)
    
    time = t - tprev

    length = xlen + ylen

    if time%2 == length%2 and time >= length:
        tprev = t
        xprev = x
        yprev = y

    else:
        result = 'NO'
        break
print(result)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

from collections import deque
b = deque([])
for i in range(1, N + 1):
    if i % 2 == 0:
        b.appendleft(a[i - 1])
    else:
        b.append(a[i - 1])

print(' '.join([str(i) for i in b]))
# Judge status: Accepted
import sys
input = sys.stdin.readline
 
 
def main():
    N = int(input())
    S = input().strip()
    ans = 0
    x = 0
    for c in S:
        if c == "#":
            x += 1
        else:
            if x > 0:
                ans += 1
                x = max(x-1, 0)
    print(ans)
 
 
if __name__ == '__main__':
    main()
# Judge status: Accepted
def main():
    total = int(input())
    mod = 1000000007
    dp = [0] * (total + 1)
    dp[0] = 1
    for i in range(1, total + 1):
        right = max(0, i - 3 + 1)
        dp[i] = sum(dp[0: right]) % mod
    return dp[total]


if __name__ == '__main__':
    print(main())
# Judge status: Accepted
from collections import Counter
n = int(input())
d = list(map(int, input().split()))
dist = Counter(d)
mod = 998244353
if d[0] != 0 or dist[0] != 1:
    print(0)
    exit()
ans = 1
for i in range(n-1):
    ans = (ans * pow(dist[i], dist[i + 1], mod)) % mod
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    ab = [list(map(int,input().split())) for _ in range(n)]
    res = 0
    for a,b in ab[::-1]:
        a += res
        if a%b != 0:
            res += b-a%b
    print(res)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, K = map(int, input().split())
Xn = list(map(int, input().split()))

dist = [abs(b-a) for a, b in zip(Xn[:-1], Xn[1:])]

ans = float("inf")
for i in range(N-K+1):
    res = abs(Xn[i]) + sum(dist[i:i+K-1])
    ans = min(res, ans)

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

l = sorted(Counter(A).items(), key=lambda x:x[0],reverse=True)
#print(l)
if l[1][1] < 2:
  print(0)
else:
  print(l[0][0]*l[1][0])
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
s = input().split(")(")
l = ""
r = ""
for i in range(len(s)):
    if len(s) != 1:
        if i % 2 == 0: s[i] += ")"
        else: s[i] = "(" + s[i]
    a = Counter(s[i])
    if "(" not in a: l += "(" * a[")"]
    elif a[")"] > a["("]: l += "(" * (a[")"] - a["("])
    elif a["("] > a[")"]: r += ")" * (a["("] - a[")"])
print(l + "".join(s) + r)
# Judge status: Wrong Answer
a , b = map(int, input().split())
if(a <= b):
    a = str(a)
    print(a*b)
else:
    b = str(b)
    print(b*a)
# Judge status: Wrong Answer
A, B = map(int, input().split())

ans = 1
i = 2
while i <= pow(min(A, B), 1/2)+1:
  if A%i == B%i == 0:
    ans += 1
    while A%i == B%i == 0:
      A //= i
      B //= i
  i += 1
print(ans)
# Judge status: Accepted
N=int(input())
AB=[list(map(int,input().split())) for i in range(N)]
count=0
for a,b in AB[::-1]:
    a+=count
    if a%b!=0:
        count+=b-(a%b)
print(count)
# Judge status: Accepted
# 0:a, b, c, a-b
# 1:b+c, a+c, a+b, b-a
# 2:2a+b+c, a+2b+c, a+b+2c, a-b
# 3:2a+3b+3c, 3a+2b+3c, 3a+3b+2c, b-a
# 4:6a+5b+5c, 5a+6b+5c, 5a+5b+6c, a-b
A, B, C, K = [int(x) for x in input().strip().split()]
ans = (A-B)*(-1)**(K%2)
if ans > 10 ** 18:
  print('Unfair')
else:
  print(ans)
# Judge status: Accepted
n=int(input())

for i in range(1,10):
    if n <= 100*i+10*i+i:
        print(100*i+10*i+i)
        break
# Judge status: Wrong Answer
SX,SY,TX,TY=map(int,input().split())
vx=TX-SX
vy=TY-SY
print('U'*vy+'R'*vx+'L'*vx+'D'*vy+'L'+'U'*(vy+1)+'R'*(vx+1)+'D'+ 'R'+'D'*(vy+1)+'L'*(vx+1)+'U')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans='Yes'
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if a[i]==a[j]:
            print(a[i],a[j])
            ans="No"
            break
print(ans)
# Judge status: Accepted
LI = lambda: list(map(int, input().split()))

N = int(input())
A = LI()


def main():
    ans = 1000
    k = 0
    for i in range(N - 1):
        if A[i] == A[i + 1]:
            continue
        if A[i] > A[i + 1]:
            ans += k * A[i]
            k = 0
        else:
            x = ans // A[i]
            ans -= x * A[i]
            k += x
    ans += k * A[-1]
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
c = input()
if c in "abcde":
    print("vowel")
else:
    print("consonat")
# Judge status: Accepted
from fractions import gcd

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

# 最小公倍数
lcm = (C * D) // gcd(C, D)

count = B
count -= B // C
count -= B // D
count += B // lcm
count -= (A - 1)
count += (A - 1) // C
count += (A - 1) // D
count -= (A - 1) // lcm

print(count)
# Judge status: Wrong Answer
nums=[int(s) for s in input().split()]

x=nums[0]
n=nums[1]

if n==0:
  print(x)
else:
  row=[int(s) for s in input().split()]
  ls=[]
  for i in range(101):
    if i not in row:
      ls.append(abs(i-x))

  ls.sort()
  if x-ls[0] not in row and x-ls[0]>=0:
    print(x-ls[0])
  else:
    print(x+ls[0])
# Judge status: Wrong Answer
x,k,d=map(int,input().split())
x=abs(x)
if x>=k*d:
    print(x-k*d)
else:
    print(min(x%d,abs(d-x%d)))
# Judge status: Accepted
n=int(input())
x,y=[],[]
for i in range(n):
    x1,y1=map(int,input().split())
    x.append(x1)
    y.append(y1)
s=0
for i in range(n):
    for j in range(n):
        if i!=j:
            s+=((x[i]-x[j])**2+(y[i]-y[j])**2)**(1/2)
print(s/n)
# Judge status: Wrong Answer
sheep, wolf = map(int, input().split())

if sheep < wolf:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

result = []
for i in range(K, N):
    if A[i] > A[i - K]:
        result.append('Yes')
    else:
        result.append('No')
print(*result, sep='\n')
# Judge status: Accepted
V = input()
N,X,T = V.split()
N = int(N)
X = int(X)
T = int(T)
if(N%X==0):
  c = N/X
else:
  c = N//X + 1
  
A = int(c*T)
  
print(A)
# Judge status: Accepted
N=str(input())
if N[-1]=="3":
    print("bon")
elif N[-1]=="0" or N[-1]=="1" or N[-1]=="6" or N[-1]=="8":
    print("pon")
else:
    print("hon")
# Judge status: Accepted
#上底の長さ
a = input()
#下底の長さ
b = input()
#高さ
h = input()
#答え
ans = 0
#文字列を数値化しつつ
#(上底+下低)*高さ/2で台形の面積を求める
ans = (int(a) + int(b)) * int(h) / 2
#答えを出力
#小数点以下が表示されるのでround()で非表示にしている
print(round(ans))
# Judge status: Wrong Answer
sx,sy,tx,ty=map(int,input().split())
dx,dy=tx-sx,ty-sy
print('L'+dx*'U'+'U'+dy*'R'+'R'+'D'+dy*'L'+dx*'D'+'D'+dy*'R'+'R'+dy*'U'+'U'+'L'+'D'+dy*'D'+dx*'L')
# Judge status: Wrong Answer
import numpy as np
 
N, M = map(int, input().split())
A = []
A = map(int, input().split())
 
dif = N - sum(A)
 
if dif >= 0:
  print(dif)
else:
  print('-1')
# Judge status: Accepted
from collections import*
def solve():
    n = int(input())
    a = list(map(int, input().split()))

    l = []
    r = []
    for i, j in enumerate(a):
        l += [i + j]
        r += [i - j]

    cnt = 0
    l = Counter(l)
    for r in r:
        cnt += l.get(r, 0)

    
    return cnt




print(solve())
# Judge status: Wrong Answer
def main():
    a, b = map(int, input().split())
    s = input()

    if s[a] != '-':
        print('No')
    else:
        print(s[:a], s[a+1:])
        if s[:a].isdigit() and s[a+1:].isdigit():
            print('Yes')
        else:
            print('No')


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = list(input())

if int(s[0])%7==0 or int(s[1])%7==0 or int(s[2])%7==0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import itertools
import math
N=int(input())
A=list(itertools.permutations(range(1,N+1)))
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))
count_P=0
count_Q=0
p=math.factorial(N)
for i in range(p):
    if P==A[i]:
        count_P=i
    if Q==A[i]:
        count_Q=i
print(abs(count_P-count_Q))
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
s = input()
c = Counter(s)
total = 1
for v in c.values():
  total *= v

for i in range(1, n - 1):
  l = i - 1
  r = i + 1
  for j in range(min(l + 1, n - r)):
    if s[i] != s[l - j] and s[l - j] != s[r + j] and s[i] != s[r + j]:
      total -= 1
print(total)
# Judge status: Wrong Answer
(N, W), *D = [list(map(int, o.split())) for o in open(0)]
w, v = 0, 1
dp = [[0]*-~W for _ in [0]*-~N]
for i in range(N):
  for j in range(W + 1):
    dp[i + 1][j] = dp[i][j] if j < D[i][w] else dp[i][j - D[i][w]] + D[i][v]
print(dp[N][W])
# Judge status: Accepted
n = input()
a,b = "",""
for i in range(len(n)//2):
    a += "01"
    b += "10"
if len(n) != len(a):
    a += "0"
    b += "1"

acount,bcount = 0,0
for i in range(len(n)):
    if n[i] != a[i]:
        acount += 1
    if n[i] != b[i]:
        bcount += 1
print(min(acount,bcount))
# Judge status: Wrong Answer
s=input()
n=len(s)

trial=(n-1)//2
for i in range(trial):
  half=trial-i
  if s[:half]==s[half:2*half]:
    print(half*2)
# Judge status: Accepted
N = int(input())

if N >= 30:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())

x = float('inf')
for _ in range(5):
    a = int(input())
    x = min(x,a)

print((n-1)//x + 5)
# Judge status: Wrong Answer
n = int(input())
l = [int(i) for i in input().split()]
count = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if(i != j and i != k and j != k):
        if(l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[k] + l[j] > l[i]):
          count += 1
          
print(count)
# Judge status: Accepted
n,x=map(int,input().split());print('No' if n*500<x else 'Yes')
# Judge status: Accepted
n=int(input())
count1=0
count2=0
count3=0
count4=0
for i in range(n):
    s=input()
    if s=='AC':
        count1+=1
    elif s=='WA':
        count2+=1
    elif s=='TLE':
        count3+=1
    else:
        count4+=1
print('AC x '+str(count1))
print('WA x '+str(count2))
print('TLE x '+str(count3))
print('RE x '+str(count4))
# Judge status: Wrong Answer
a,b,t = map(int,input().split())
if t < a:
    print(0)
elif a<=t<2*a:
    print(b)
elif 2*a<=t<3*a:
    print(2*b) 
else:
    print(3*b)
# Judge status: Accepted
import numpy as np

X = np.array(list(map(int, input().split())))

print(np.where(X==0)[0][0]+1)
# Judge status: Accepted
n = int(input())
s = input()
mod = 10**9 + 7
car = [0] * 26

for i in range(n):
	car[ord(s[i])-97] += 1

ans = 1
for i in range(26):
	if car[i] == 0:
		continue
	else:
		ans *= (car[i]+1)
		ans %= mod

print(ans - 1)
# Judge status: Accepted
a=int(input());b=int(input());h=int(input())
print((a+b)*h//2)
# Judge status: Wrong Answer
ans=0

def br(s):
  global ans
  ns=[]
  fl=True
  i=0
  while i <len(s)-1:
    if s[i:i+2]==["0","1"] or s[i:i+2]==["1","0"]:
      ans+=2
      i+=1
      fl=False
    else:
      ns.append(s[i])
    i+=1
  if fl or len(ns)==0:
    return 0
  else:
    br(ns)

br(list(input()))
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = a * b

if c % 2 == 0:
    print('Odds')

else:
    print('Even')
# 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
a,b = list(map(int,input().split()))
D = b-a
print(D*(D+1)//2-b)
# Judge status: Accepted
n = int(input())
a=[]
b=[]
for i in range(n):
    h,m=list(map(int,input().split()))
    a.append(h)
    b.append(m)
a.sort()
b.sort()

if n%2:
    k=(n-1)//2
    
        
    print(b[k]-a[k]+1)
else:
    k=n//2
    

    
    print(b[k]+b[k-1]-(a[k]+a[k-1])+1)
# Judge status: Wrong Answer
import collections
n = int(input())
a = list(map(int,input().split()))
b = collections.Counter(a)
ans = 0

for key,value in b.items():
    ans += abs(key-value)

ans = min(ans,n)
print(ans)
# Judge status: Wrong Answer
S=str(input())

if ('hii' in S):
    print('No')
elif ('hi' in S):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
def main():
    # n = int(input())

    [D, T, S] = [int(x) for x in input().split()]

    if D/S <= T:
        print('YES')
    else:
        print('NO')











main()
# Judge status: Wrong Answer
n,m=map(int,input().split())
xy=[]
for _ in range(m):
    x,y=map(int,input().split())
    xy.append([x,y])

ball=[1]*n
red=[0]*n
red[0]+=1

for i in range(m):
    if red[xy[i][0]-1]==1:
        if ball[xy[i][0]-1]==1:
            red[xy[i][0]-1]-=1
        red[xy[i][1]-1]+=1
    ball[xy[i][0]-1]-=1
    ball[xy[i][1]-1]+=1

ans=len(red)-red.count(0) 
print(ans)
# Judge status: Accepted
def solve():
    N, M = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(N)]
    A.sort()
    ans = 0
    cnt = 0
    for a in A:
        if cnt + a[1] <= M:
            ans += a[1]*a[0]
            cnt += a[1]
        else:
            ans += a[0]*(M-cnt)
            break
    return ans
print(solve())
# Judge status: Wrong Answer
N=int(input())
s=input()
i_count=0
max_count=0
for i in range(N):
    if s[i]=="I":
        i_count+=1
        if i_count>max_count:
            max_count=i_count
print(max_count)
# Judge status: Wrong Answer
#!/usr/bin/env python3

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

ans = 0
if (b-a)%2 == 0:
    ans = int((b-a)/2)
else:
    if a-1 >= n-b:
        ans = int(n+(1-a-b)/2)
    else:
        ans = int(a + (b-a)/2)

print(ans)
# Judge status: Wrong Answer
N,K =map(int , input().split())
A = []
for i in range(K):
  d = int(input())
  A += map(int , input().split())
  print(set(A))
print(N-len(set(A)))
# Judge status: Accepted
n=int(input())
act=[0]*n
for i in range(n):
    act[i]=list(map(int,input().split()))
dp=[[0]*3 for _ in range(n)]
dp[0]=[act[0][0],act[0][1],act[0][2]]
for i in range(1,n):
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+act[i][0]
    dp[i][1]=max(dp[i-1][2],dp[i-1][0])+act[i][1]
    dp[i][2]=max(dp[i-1][0],dp[i-1][1])+act[i][2]
print(max(dp[n-1][0],dp[n-1][1],dp[n-1][2]))