peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n,m=INTM()
    alist=[]
    for i in range(n):
        ka=LIST()
        ka.pop(0)
        ka=set(ka)
        alist.append(ka)
    for i in range(n-1):
        alist[n-1]=alist[n-1]&alist[i]
    print(len(alist[n-1]))
if __name__ == '__main__':
    do()
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

base = 0
for h in H:
    if(base > h):
        print("No")
        break
    base = max(base, h-1)
else:
    print("Yes")
# Judge status: Accepted
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
m = 10**7
a = 1
i = 1

while a <= m:
    if a >= n:
        break
    i+=1
    a+=i

ans = [j for j in range(1,i+1) if j != a-n]

print(*ans,sep="\n")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for i in range(N, 0, -1):
    ans += min(A[i], B[i - 1])
    B[i - 1] -= min(A[i],B[i - 1])
    ans += min(A[i - 1],B[i - 1])
    B[i - 1] -= min(A[i - 1], B[i - 1])
print(ans)
# Judge status: Accepted
k,s=map(int,input().split())
count=0
for x in range(k+1):
  for y in range(k+1):
      if k>=s-x-y>=0:
        count+=1
print(count)
# Judge status: Accepted
import sys
readline = sys.stdin.readline

from fractions import Fraction
A,B = readline().split()
A = int(A)
B = Fraction(B)

print(int(A * B))
# Judge status: Accepted
mod = 10 ** 9 + 7
x, y = [int(i) for i in input().split()]
if (2*x - y) % 3 != 0 or (2*y - x) % 3 != 0:
  print(0)
  exit()
a = (2*x - y) // 3
b = (2*y - x) // 3
if a < 0 or b < 0:
  print(0)
  exit()
def mygcd(a_b, b, mod):
    b = min(a_b, b)
    cnt = 1
    for i in range(b):
        cnt = cnt * (a_b - i) * pow(i+1, mod-2, mod) % mod
    return cnt
print(mygcd(a+b, b, mod))
# Judge status: Accepted
N = int(input())

def calculate(n):
    n = n % 10

    s1 = [2,4,5,7,9]
    s2 = [0,1,6,8]

    if n in s1:
        print("hon")
        return

    if n in s2:
        print("pon")
        return

    print("bon")

calculate(N)
# Judge status: Wrong Answer
S=input()
ans=0
a=0
b=3
if len(S)<4:
  print(0)
else:
  while True:
    if int(S[a:b])%2019==0:
      ans+=1
    b+=1
    if b==len(S)+1:
      a+=1
      b=a+3
    if a==len(S)-3:
      break
print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
S=input()

if str.isdecimal(S[0:A]) and S[A]=="-" and str.isdecimal(S[A+1:]):
    #print(str.isdecimal(S[0:A]))
    #print(S[A]=="-")
    #print(str.isdecimal(S[A+1:]))
    #print(S[A+2:])
    
    print("Yes")
else:
    #print(str.isdecimal(S[0:A]))
    #print(S[A])
    #print(str.isdecimal(S[A+1:]))
    #print(S[A+1:])
    
    print("No")
# Judge status: Accepted
n,m = map(int, input().split())

min_ = 1
max_ = 10**5
for i in range(m):
    l,r = map(int, input().split())
    min_ = max(min_, l)
    max_ = min(max_, r)

ans = max(0, max_ - min_ + 1)
print(ans)
# Judge status: Accepted
S = input()

result = 'No'
for i in range(1, 6):
    if S == 'hi' * i:
        result = 'Yes'
        break
print(result)
# Judge status: Accepted
N = int(input())

# 2で割れる最大数は2**x. 2**x がNを超えるかどうかで判定する
for x in range(10):
    if N < 2**x:
        break

print(2**(x-1))
# Judge status: Accepted
X = list(input())
nt, ns = 0, 0
for x in X:
    if x == 'S':
        ns += 1
    elif ns > 0:
        ns -= 1
    else:
        nt += 1
print(nt+ns)
# Judge status: Wrong Answer
def main():
    a,b,c = map(int, input().split())
    if b - a == c - b:
        print('Yes')
    else:
        print('No')
main()
# Judge status: Accepted
n,k=map(int,input().split())
X=list(map(int,input().split()))
r=10**9
for i in range(n-k+1):
    a=X[i]
    b=X[i+k-1]
    if a*b>=0:
        t=max(abs(a),abs(b))
    else:
        t=min((-a)*2+b,(-a)+2*b)
    r=min(r,t)
print(r)
# Judge status: Accepted
#include<bits/stdc++.h>
n,k=map(int,input().split())
s=input()
c=""
for i in range(n):
  if i==k-1:
    c+=s[i].lower()
  else:
    c+=s[i]
print(c);
# Judge status: Wrong Answer
s = input()
if s[0] != 'A':
  print('WA')
  exit()
sho = ord('a')
ok = 0
for i in s[2: len(s) - 1]:
  if ord(i) < sho:
    if ord(i) == ord("C"):
      ok += 1
    else:
      print("WA")
      exit()
if ord(s[0]) < sho or ord(s[1]) < sho or ord(s[len(s) - 1]) < sho:
  print("WA")
  exit()
if ok == 1:
  print("AC")
else:
  print("WA")
# Judge status: Wrong Answer

import numpy as np
import sys

input = sys.stdin.readline

s = int(input())

ans = 1
cnt = 0
if s == 4:
    cnt +=1
i = 0
while (s != 4 or cnt < 2):
    ans +=1
    if s % 2 == 0:
        s = int(s/2)
    else:
        s = 3*s + 1
    
    if s == 4:
        cnt +=1


print(ans)
# Judge status: Wrong Answer
import math
n=int(input())
s=input()
s1=s[:n//2]
s2=s[n-(n//2):]
if n%2==0:
    print('No')
elif s1==s2:
    print('Yes')
else :
    print('No')
# Judge status: Wrong Answer
s=input()
print("AC" if s[0]=="A" and s[2:-1].count("C")==1 else "WA")
# Judge status: Accepted
# -*- coding: utf-8 -*-
import numpy as np

count=0
num_of_nums=input()
nums=np.array(input().split())
nums=nums.astype(int)

while np.all(nums%2==0):
    nums=nums/2
    count+=1

print(count)
# Judge status: Accepted
N, W = map(int, input().split())
K = [[] for i in range(N)]
for i in range(N):
    K[i] = list(map(int, input().split()))

dp = [[0 for _ in range(W+1)] for _ in range(N+1)]
for i in range(1,N+1):
    w, v = K[i-1]
    for sum_w in range(W+1):
        if sum_w-w>=0:
            dp[i][sum_w] = max(dp[i-1][sum_w], dp[i-1][sum_w-w]+v)
        else:
            dp[i][sum_w] = dp[i-1][sum_w]
print(dp[-1][-1])
# Judge status: Accepted
import numpy as np
w,h,n = map(int, input().split())
area = np.array([[1]*w]*h)

for _ in range(n):
  x,y,a = map(int, input().split())
  if a == 1:
    area[:,:x]=0
  elif a == 2:
    area[:,x:]=0
  elif a == 3:
    area[:y,:]=0
  elif a == 4:
    area[y:,:]=0
print(area.sum())
# Judge status: Accepted
s = str(input())
for i in range(len(s)//2):
    if s[i] != s[-(i+1)]:
        print("No")
        exit()
for i in range(len(s)//4):
    if s[i] != s[(len(s)//2-i-1)]:
        print("No")
        exit()
for i in range(len(s) - (len(s)+3)//2):
    if s[(len(s)+3)//2+i-1] != s[-(i+1)]:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
n,a,b,c,d = map(int,input().split())
s = list(input())
for i in range(min(a,b),max(c,d)):
    if s[i] == "#" and s[i+1] == "#":
        print("No")
        quit()
if c < d:
    print("Yes")
elif c > d:
    for j in range(b-1,d):
        if s[j] == "." and s[j+1] == "." and s[j-1] == ".":
            print("Yes")
            quit()
    print("No")
# Judge status: Accepted
from fractions import gcd

def lcm(a,b):
    return (a*b) // gcd(a,b)

A, B = map(int, input().split())
C = lcm(A,B)
print(C)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if b<=a**500:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
N,K = map(int, input().split())
A_list = list(map(int, input().split()))
lb = 0
ub = 10**9

for i in range(100):
    middle = (lb + ub)/2
    sumi = -N
    for a in A_list:
        sumi += math.ceil(a/middle)

    if sumi <= K:
        ub = middle
    else:
        lb = middle
print(math.ceil(middle))
# Judge status: Accepted
S = input()
T = input()
ans = 1e10
for i in range(len(S)):
    if i+len(T) > len(S):
        break
    cnt = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            cnt += 1
    ans = min(cnt, ans)
print(ans)
# Judge status: Wrong Answer
import bisect
n, m = map(int, input().split())

# 市番号
order = []
pre = [[0] for _ in range(n + 1)]

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

# 各県ごとにソート
for i in range(n + 1):
    pre[p].sort()

# 市番号順に，各県の何番目かをにぶたんで探す
for pp, year in order:
    print('{:0>6}'.format(pp) +
          '{:0>6}'.format(bisect.bisect_left(pre[pp], year)))
# Judge status: Accepted
ans = 0
li = sorted(list(map(int, input().split())))
ans += (li[1] - li[0]) // 2
ans += (li[2] - li[1])
if (li[1] - li[0]) % 2 == 1:
    ans += 2
print(ans)
# Judge status: Accepted
from itertools import permutations

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

ans = 0

for i, pe in enumerate(permutations(range(1, N + 1))):
    if P == pe:
        ans += i
    if Q == pe:
        ans -= i

print(abs(ans))
# Judge status: Accepted
import fractions
N = int(input())
A = [int(i) for i in input().split()]

m = min(A)

for i in range(N):
    if A[i] % m != 0:
        print(fractions.gcd(m, A[i]))
        exit()
print(m)
# 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')

X = int(input())

ans = 1
for i in range(2, X):
    b = i
    p = 2
    a = b ** p
    while a <= X: 
        ans = max(ans, a)
        p += 1
        a = b ** p
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a<=b<0:
  print('Negative' if (-1)**(a-b-1)==-1 else 'Positive')
elif a<=0<=b:
  print('Zero')
else:
  print('Positive')
# Judge status: Accepted
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]
smax = max(Counter(s).values())
kmax = [k for k, v in Counter(s).items() if v == smax]
print("\n".join(sorted(kmax)))
# Judge status: Wrong Answer
N, A, B = map(int, input().split())

if ((B-A)+1)%2==0:
    print(B-1)
else:
    print((B-A)/2)
# Judge status: Wrong Answer
n=int(input())
b =list(map(int,input().split()))

res=[0] * n

for i in range(n):
    res[b[i]-1] = i+1

for i in res:
    print(i,end='')
# Judge status: Accepted
def main():
    A, B, C = map(int, input().split())
    nums = [A, B, C]
    nums.sort()
    ans = nums[2]*10 + nums[1] + nums[0]
    print(ans) 
main()
# Judge status: Accepted
a, b = map(int, input().split())
c = abs(a - b) 
if c % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int(min(a, b) + c / 2))
# Judge status: Accepted
N, L = map(int, input().split())
ans = 0
sa = 10000
for i in range(N):
  ans += L+i
  if abs(sa) > abs(L+i):
    sa = L+i
print(ans - sa)
# Judge status: Accepted
x = int(input())

import math



def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

while(1):
    if(is_prime(x)):
        print(x)
        break
    x += 1
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
 
ans = 0
 
for i in range(N):
  ans += B[A[i]-1]
  if i >0 and A[i] - A[i-1] ==1:
    ans += C[A[i]-2]
        
print(ans)
# Judge status: Wrong Answer
n,l=map(int,input().split())
s=(l-1)*n+n*(n+1)/2
if n>=1:
  print(s-1)
elif n>=1-l:
  print(s-1+l)
else:
  print(s-n)
# Judge status: Wrong Answer
p = list(map(int, input().split()))
ans  = list(range(p[1]-p[0]+1, p[1]+p[0]))
print(ans)
# Judge status: Accepted
s = list(input())
t = list(input())
m = 0
for i in range(len(s)-len(t)+1):
    x = 0
    for j in range(len(t)):
        if t[j] == s[i+j]:
            x+=1
    if x > m:
        m = x
ans = len(t)-m
print(ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
h=[int(input()) for i in range(n)]
h.sort()
ans=float('inf')
for i in range(n-k):
  d=h[i+k-1]-h[i]
  if d<ans:
    ans=d
print(ans)
# Judge status: Accepted
c=input()
if c=='a' or c=='e' or c=='i' or c=='o' or c=='u':
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
from operator import itemgetter

N = int(input())
job = [list(map(int, input().split())) for i in range(N)]

job.sort(key = itemgetter(1))

time = 0
flag = 0
for i in range(N):
    time += job[i][0]
    if time > job[i][1]:
        flag = 1
    print(flag)    
    
if flag == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006) - A)] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])
# Judge status: Wrong Answer
# ABC 077
import bisect

N = int(input())
A = [int(j) for j in input().split()]
B = [int(j) for j in input().split()]
C = [int(j) for j in input().split()]
ans = 0
for a in A:
    for c in C:
        if a < B[-1]:
            A_ =bisect.bisect_left(B,a)
            C_ =bisect.bisect_right(B,c)
            ans += C_-A_
print(ans)
# Judge status: Accepted
import numpy as np

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

from numba import jit

@jit
def imos(x):
  global N
  B = np.zeros_like(x)
  for i in range(N):
    p = x[i]
    L = max(i-p, 0)
    R = min(i+p, N-1)
    B[L] += 1
    if R < N-1:
      B[R+1] -= 1
  B = np.cumsum(B)
  return B

for i in range(K):
  if i >= 50:
    break
  A = imos(A)

print(*A)
# Judge status: Accepted
a = int(input())
b = int(input())
lis = [a, b]
ans = 2
if max(lis) == 2:
    ans = 3
elif min(lis) == 2:
    ans = 1
print(ans)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def gcd(a,b):
    while b:a,b=b,a%b
    return a

def main():
    a,b,c=MI()
    g=gcd(a,b)
    if c%g:print("NO")
    else:print("YES")

main()
# Judge status: Accepted
print('YES' if int(input()) in [7,5,3] else 'NO')
# Judge status: Wrong Answer
import math
R = int(input())

print(R**2 * math.pi)
# Judge status: Accepted
S = [list(input()) for _ in range(3)]
d = {0: "a", 1: "b", 2: "c"}
D = {"a":0, "b":1, "c":2}

n = 0
for _ in range(len(S[0]) + len(S[1]) + len(S[2])):
  N = n
  if len(S[n]) > 0:
    n = D[S[n][0]]
    S[N].pop(0)
  else:
    print(str.upper(d[n]))
    break
# Judge status: Accepted
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = []
for _ in range(n):
    A.append(inint())

sorted_A = sorted(A)[::-1]

for a in A:
    if a != sorted_A[0]:
        print(sorted_A[0])
    else:
        print(sorted_A[1])
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

distance = abs(B-A)
diff = V-W

if distance - diff * T <= 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a,b,c,k=map(int,open(0).read().split())
while a>=b:b*=2;k-=1
while b>=c:c*=2;k-=1
print('YNeos'[k<0::2])
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
 
ans = 0
tmp = 0
for i in range(N-1):
	if H[i] >= H[i+1]:
		tmp += 1
	else:
		if ans < tmp:
			ans = tmp
		tmp = 0
if ans < tmp:
	ans = tmp
 
print(ans)
# Judge status: Accepted
a,b,c = sorted(map(int,input().split()))
ans = 0
ans += (c-b)//2
b += (c-b)//2*2
ans += (c-a)//2
a += (c-a)//2*2
a,b,c = sorted([a,b,c])
if a==b and b!=c:
  print(ans+1)
elif a==b==c:
  print(ans)
elif b==c and b!=a:
  print(ans+2)
# Judge status: Accepted
x,n=map(int,input().split())
a=list(map(int,input().split()))

i=0

while True:
    if not x-i in a:
        print(x-i)
        break
    if not x+i in a:
        print(x+i)
        break
    i+=1
# Judge status: Wrong Answer
r, g, b = map(int, input().split())

n = r * g * b
if n % 4 == 0:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
k,s = map(int, input().split())
c=0
for i in range(k+1):
	for j in range(k+1):
		if s>=i+j and k+1+i+j>s :
			c+=1
			# print( c )

print( c )
# Judge status: Accepted
a, b, c = map(int, input().split())
print(min(b//a,c))
# Judge status: Wrong Answer
n=int(input())

t = input().split()

count = 0

for i in range(n-2):
    A = t[i:i+3]
    #print(A)
    y = A[1]
    A.sort()

    if y == A[1]:
        count += 1
print(count)
# Judge status: Accepted
import re
S = input()
print("YES" if re.match("^(dream|dreamer|erase|eraser)+$", S) else "NO")
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().split()]
import fractions
from functools import reduce

def gcd(*numbers):
    return abs(reduce(fractions.gcd, numbers))

L = [A[0]]
R = [A[-1]]
A_R = A[::-1]
for i in range(1, N):
    L.append(fractions.gcd(L[-1], A[i]))
    R.append(fractions.gcd(R[-1], A_R[i]))
R = R[::-1]
ans = R[1]
R.append(0)
for i in range(N - 1):
    ans = max(ans, fractions.gcd(L[i],R[i+2]))
print(ans)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

start = 0
left = 0
right = 1
ans = 0

while right < N:
    if H[left] >= H[right]:
        left += 1
        right += 1
    else:
        ans = max(ans, right - start - 1)
        left = right
        right += 1
        start = left
        
ans = max(ans, right - start - 1)
print(ans)
# Judge status: Accepted
import sys

N, C, K = map(int ,input().split())
T = [int(input()) for _ in range(N)]
T.sort()

if C == 1:
	print(N)
	sys.exit()

cnt = 0
capacity = 0
time_limit = 0
for i in range(N):
	if capacity == 0:
		capacity += 1
		time_limit = T[i] + K
		continue
	if capacity > 0:
		if T[i] <= time_limit:
			capacity += 1
			if capacity == C:
				cnt += 1
				capacity = 0
				continue
		elif T[i] > time_limit:
			cnt += 1
			capacity = 1
			time_limit = T[i] + K


print(cnt+1)
# Judge status: Accepted
W = input()
if W[0] == 'R' and  W[1] == 'R' and  W[2] == 'R':
    print(3)
elif (W[0] == 'R' and  W[1] == 'R') or (W[1] == 'R' and  W[2] == 'R'):
    print(2)
elif W[0] == 'S' and  W[1] == 'S' and  W[2] == 'S':
    print(0)
else:
    print(1)
# Judge status: Accepted
s = 'abcdefghij'
sg = s.__getitem__


def dfs(ans):
    if len(ans) == n:
        print(''.join(map(sg, ans)))
        return
    for i in range(max(ans) + 2):
        ans.append(i)
        dfs(ans)
        ans.pop()


n = int(input())
dfs([0])
# Judge status: Accepted
n, m = list(map(int, input().split()))
hs =  list(map(int, input().split()))
ans = [1]*n
for i in range(m):
    road = list(map(int, input().split()))
    if hs[road[0]-1] <= hs[road[1]-1]:
        ans[road[0]-1] = 0
    if hs[road[0]-1] >= hs[road[1]-1]:
        ans[road[1]-1] = 0
print(ans.count(1))
# Judge status: Accepted
n=int(input())
money=[1]
dp=[0]*(n+1)
dp[1]=1
m=6
i=1
while m<=n:
  money.append(m)
  i+=1
  m=6**i
m=9
i=1
while m<=n:
  money.append(m)
  i+=1
  m=9**i

for m in money:
  dp[m]=1

money.sort()
for i in range(1,n+1):
  for m in money:
    if i+m>=n+1:
      continue
    if dp[i]+1<=dp[i+m] or dp[i+m]==0:
      dp[i+m]=dp[i]+1
      
print(dp[n])
# Judge status: Accepted
S=list(input())
print("yes" if len(set(S))==len(S) else "no")
# Judge status: Accepted
from collections import deque
K = int(input())

Q = deque()
for i in range(1, 10):
    Q.append(i)

while K > 0:
    q = Q.popleft()
    a = q % 10
    if a == 0:
        Q.append(q * 10)
        Q.append(q * 10 + 1)
    elif a == 9:
        Q.append(q * 10 + 8)
        Q.append(q * 10 + 9)
    else:
        Q.append(q * 10 + a - 1)
        Q.append(q * 10 + a)
        Q.append(q * 10 + a + 1)
    K -= 1

print(q)
# Judge status: Wrong Answer
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

data = {}
for x in ["a","b","c"]:
    data[x] = input()

pick = "a"
while True:
    data[pick] = data[pick][1:]
    if data[pick] == "":
        break
    
    pick = data[pick][0]
print(pick.upper())
# Judge status: Wrong Answer
X=input()
A=len(X)
for i in range(A//5):
  X=X.replace("ST","")
print(len(X))
# Judge status: Wrong Answer
import math
n = int(input())

#Prime factoring
pf = []
for i in range(2,math.ceil(n**0.5)+1):
    temp = 0
    while n%i==0:
        n /= i
        temp += 1
    if temp:
        pf.append(temp)
    if n==1:
        break
if not pf:
    pf.append(1)

ans =  0
for i in range(len(pf)):
    j = 1
    while pf[i]-j>=0:
        ans += 1
        pf[i] -= j
        j += 1
print(ans)
# Judge status: Accepted
n = int(input())

al = [int(input()) for _ in range(n)]

if n == 1:
    print(al[0] // 2 * 2 // 2)
    exit()
ans = 0
for i in range(n-1):
    rest = ((al[i] + al[i+1]) // 2) * 2
    ans += rest
    for j in range(2):
        if al[i+j] >= rest:
            al[i+j] -= rest
            break
        else:
            rest -= al[i+j]
            al[i+j] = 0


print(ans//2)
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
ans=abs(b-a+1)/x
ans_a=a/x
ans_b=b/x
print(round(ans_b-ans_a))
# Judge status: Accepted
N, K = map(int, input().split())

count = 1

while N//K != 0:
    N //= K
    count += 1

print(count)
# Judge status: Accepted
from collections import Counter
w=input()
c=Counter(w).values()
s="Yes"
for i in c:
  if i%2==1:
    s="No"
print(s)
# Judge status: Accepted
n = int(input())
l = [input() for _ in [0]*n]
if len(set(l)) != n:
    print('No')
else:
    for i in range(n-1):
        if l[i][-1] != l[i+1][0]:
            print('No')
            break
        else:
            continue
    else:
        print('Yes')
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
k = int(input())

for i in range(k):
    if r < g < b:
        break
    else:
        if b < g and b < r:
            b *= 2
        elif g < r:
            g *= 2
        else:
            r *= 2

if r < g < b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
print(s.rfind('Z') + 1 - s.find('A'))
# Judge status: Accepted
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    N,X,T = LI()
    ans = math.ceil(N/X)*T
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
n, p = map(int, input().split())
a = list(map(int, input().split()))
dp = [[0, 0] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(2):
        dp[i+1][j] += dp[i][j]
        dp[i+1][(j+a[i])%2] += dp[i][j]
print(dp[n][p])
# Judge status: Accepted
##D
H = int(input())
x = 0
while H//2**x != 1:
    x += 1
ans = 1
for i in range(x):
    ans += 2**(i+1)
print(ans)
# Judge status: Wrong Answer
def next_pos(D,L):
    return D+L
    
N, X = map(int,input().split(" "))
L = [int(i) for i in input().split(" ")]
D = 0
count = 0

for i in range(N):
    if D<=X:
        count+=1
    D = next_pos(D,L[i])

    
print(count)
# Judge status: Accepted
h, n = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]
#(a,b):=(ダメージ,消費魔力)

dp = [float('inf')] * (h + 1)
dp[0] = 0

for i in range(h + 1):
    for j in range(n):
        if dp[i] == float('inf'):continue
        temp_a = i + ab[j][0] if i + ab[j][0] < h else h
        temp_b = dp[i] + ab[j][1]

        dp[temp_a] = min(dp[temp_a], temp_b)

print(dp[-1])
#print(dp)
# Judge status: Accepted
import math
A, B ,X = map(int,input().split())
C =  2 * X / A / B
if C <= A:
    print(math.degrees(math.atan(B/C)))
else:
    C = 2*(A**2 * B - X) / (A**2)
    print(math.degrees(math.atan(C/A)))
# Judge status: Accepted
if sorted(list(input()))==["a","b","c"]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

INF = 10**18

N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort()

ans = 0
x0, y0 = XY[0]
m1 =  -x0+y0# 今ままでのmax
m2 = x0+y0
for x, y in XY:
    ans = max(ans, x+m1 - y)
    ans = max(ans, y - (-x+m2))
    m1 = max(m1, -x+y)
    m2 = min(m2, x+y)
print(ans)