peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def func(num, memo):
    if memo[num] != -1:
        return memo[num]

    ans = 0
    if num == 0:
        return 1

    if num < 3:
        return ans

    for i in range(3, num + 1):
        ans += func(num - i, memo)
        ans %= 10 ** 9 + 7

    memo[num] = ans
    return ans


s = int(input())

memo = [-1] * (s + 1)

if s < 3:
    print(0)
else:
    print(func(s, memo))
# Judge status: Accepted
n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
ed = []
for i in range(n):
    for j in range(i):
        for k in range(j):
            if (l[k] != l[j] and l[i] != l[j] and l[k] + l[j] > l[i]):ans+=1

print(ans)
# Judge status: Accepted
n = input()
if "9" in n:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N,M=input().split()
N=int(N)
M=int(M)
A=[int(x) for x in input().split()]
i=0
sum_A=0
result=0
if (1<=N<=10**6)and(1<=M<=10**4):
    for i in range(0,M):
        if 1<=A[i]<=10**4:
            sum_A+=A[i]
            i+=1
    result=N-sum_A
    if result<0:
        print(-1)
    else:
        print(result)
# Judge status: Accepted
a,b=map(int,input().split())
print("Yay!" if a<=8 and b<=8 else ":(")
# Judge status: Accepted
g=[[*map(int,input().split())]for _ in range(3)]
for h in [0,1]:
  for w in [0,1]: 
    if g[h][w]+g[h+1][w+1]!=g[h+1][w]+g[h][w+1]:
      exit(print('No'))
print('Yes')
# Judge status: Accepted
# 別解: 総当たり(Brute Force)で解く

n, m = [int(i) for i in input().split()]
s = []
c = []
for _ in range(m):
    i, k = [int(i) for i in input().split()]
    s.append(i)
    c.append(k)

res = -1
start = 10**(n-1) if n > 1 else 0
for i in range(start, 10**n):
    i2s = str(i)
    for ss, cc in zip(s, c):
        if i2s[ss-1] != str(cc):
            break
    else:
        res = i
        break

print(res)
# Judge status: Accepted
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = Counter(a).most_common()[::-1]
# print(cnt)
# print(cnt)
ans = 0
for i in range(len(cnt) - k):
    ans += cnt[i][1]
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())

print("Yes") if M == N else print("No")
# Judge status: Wrong Answer
n=int(input())
b=list(map(int,input().split()))
a=[]

a.append(b[0])
for i in range(1,n-1) :
  if b[i-1] < b[i] :
    a.append(b[i-1])
  else :
    a.append(b[i])
a.append(b[n-2])  
print(a)
print(sum(a))
# Judge status: Accepted
a = int(input())
b = list(map(int,input().split()))

c = sorted(b, reverse=True)

m = int(a / 2) - 1
anslist = [0] * a
for i, data in enumerate(b):
    if c[m] > data:
        anslist[i] = c[m]
    elif c[m] <= data:
        anslist[i] = c[m + 1]
        
for j in range(a):
    print(anslist[j])
# Judge status: Accepted
N, D = [int(_) for _ in input().split()]

ans = 0
for i in range(N):
    X, Y = [int(_) for _ in input().split()]
    if X * X + Y * Y <= D * D:
        ans += 1
print(ans)
# Judge status: Accepted
import math
N = int(input())

C = []
S = []
F = []
for _ in range(N - 1):
    c, s, f = map(int, input().split())
    C.append(c)
    S.append(s)
    F.append(f)


for i in range(N - 1):
    count = 0
    count += S[i]
    count += C[i]
    for j in range(i + 1, N - 1):
        if count < S[j]:
            count = S[j]
        else:
            count = math.ceil((count - S[j]) / F[j]) * F[j] + S[j]
        count += C[j]
    print(count)
print(0)
# Judge status: Accepted
import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
ans = [i[0] for i in c.items() if i[1] >= 2]
ans.extend([i[0] for i in c.items() if i[1] >= 4])
ans.extend([0,0])
ans.sort(reverse=True)
print(ans[0]*ans[1])
# Judge status: Accepted
s = input()
 
if s == "hi" * int(len(s) / 2):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
l = []
cnt = 0
for i in range(5):
    l.append(int(input()))
    
k = int(input())

for i in range(len(l)):
    for j in range(len(l)):
        if i < j and abs(l[i] - l[j]) <= k:
            cnt += 1
            
if cnt == 10:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
n, m = map(int, input().split())
height = [0] + list(map(int, input().split()))
mawari = [0] * (n+1) 
ans = 0

for _ in range(m):
    a, b = map(int, input().split())
    mawari[a] = max(mawari[a], height[b])
    mawari[b] = max(mawari[b], height[a])
    

for i in range(1,n+1):
    if height[i]> mawari[i]:
        ans += 1
print(ans)
# Judge status: Accepted
import numpy
N,M,X = map(int,input().split())
A = numpy.array([[int(i) for i in input().split()] for _ in range(N)])
ans = 10**8
for i in range(2**N) :
    i = format(i,'b').zfill(N)
    check = numpy.array([0]*(M+1))
    for j in range(N) :
        if i[j] == '0' :
            continue
        check +=  A[j][0:]
    if all (check[m] >= X for m in range(1,M+1)) :
        ans = min(ans,check[0])

if ans == 10**8 :
    print(-1)
else :
    print(ans)
# Judge status: Wrong Answer
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n , k = map(int, input().split())
    a = list(map(int, input().split()))
    from heapq import heappop, heappush, heapreplace
    a = [-x for x in a]
    a.sort()
    for i in range(k):
        x = a[0]
        if abs(x) < 1:
            break
        heapreplace(a, x//3)
        heappush(a, x-x//2)
    ans = abs(a[0])
    print(ans)
    


if __name__ == '__main__':
    main()
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[27]:


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


# In[30]:


MOD = 2019
res = MOD
if R - L < MOD:
    for l in range(L, R):
        for r in range(l+1, R+1):
            res = min(res, (l * r) % MOD)
else:
    res = 0
print(res)
# Judge status: Accepted
N = contest_numer =int(input())
if contest_numer > 999 and 1998 >= contest_numer:
    print("ABD")

elif contest_numer > 0 and 999 >= contest_numer:
    print("ABC")

else:
    print("contest that you inputted now has not been held")
# Judge status: Accepted
n = int(input())
s = input()

ans = 0
x = 0
for c in s:
    if c == 'I':
        x += 1
    else:
        x -= 1
    ans = max(ans, x)
print(ans)
# Judge status: Accepted
A = list(input())
B = list(input())
C = list(input())
now = "a"
d = {"a": A, "b": B, "c": C}
while A or B or C:
    if not d[now]:
        print(now.upper())
        break
    else:
        now = d[now].pop(0)
# Judge status: Wrong Answer
n = int(input())
S = input().strip()

print(max(len(set(S[i+1:]) & set(S[:i])) for i in range(n)))
# Judge status: Accepted
S = input()

used = set([s for s in S])
if (len(S) - len(used) == 0):
    print("yes")
else:
    print("no")
# Judge status: Accepted
H, W = map(int, input().split())
 
if H == 1:
  print(1)
elif  W == 1:
  print(1)
else:
  print(-((-H * W)//2))
# Judge status: Accepted
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    q, h, s, d = [int(x) for x in input().rstrip().split(" ")]
    n = int(input().rstrip())

    h = h if h < 2 * q else 2 * q
    s = s if s < 2 * h else 2 * h
    d = d if d < 2 * s else 2 * s

    ans = 0

    ans += (n // 2) * d
    n = n % 2

    ans += n * s

    print(ans)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
t = input()
u = []
for i in range(len(t)):
    if t[i] == '?':
        u.append('D')
    else:
        u.append(t[i])

u = ''.join(u)
print(u)
# Judge status: Accepted
#c
N=int(input())
ans=0
for i in range(1,N):
    s = N//i
    if i*s <N:
        ans += s
    else:
        ans += s-1
print(ans)
# Judge status: Accepted
s = input()
ACGT = ["A","C","G","T"]
ans = 0
ANS = [0]

for i in range(len(s)):
    if s[i] in ACGT:
        ans += 1
    else:
        ans = 0
        
    ANS.append(ans)
        
print(max(ANS))
# Judge status: Wrong Answer
s=input()
l='abcdefghijklmnopqrstuvwxyz'
s=''.join(list(set(s)))
s=sorted(s)
f=0
r='None'
for i in range(len(s)):
    if(s[i]!=l[i]):
        r=l[i]
        f=1
        break
print(r)
# Judge status: Accepted
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,m = mi()
av = li()
bv = li()

avs = av.copy()
bvs = bv.copy()
avs.sort()
bvs.sort()

ans = avs[0] + bvs[0]

for i in range(m):
    q = li()
    tmp = av[q[0]-1] + bv[q[1]-1] - q[2]
    ans = min(ans, tmp)

print(ans)
# Judge status: Accepted
N = int(input())
l = [input() for i in range(N)]
print("AC x {0}".format(l.count('AC')))
print("WA x {0}".format(l.count('WA')))
print("TLE x {0}".format(l.count('TLE')))
print("RE x {0}".format(l.count('RE')))
# Judge status: Accepted
n , m = map(int,input().split())
ans = 1
for i in range(1,int(m**0.5)+1):
    if m % i == 0:
        x = m//i
        if x >= n:
            ans = max(ans,i)
        if i >= n:
            ans = max(ans,x)
print(ans)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))

L,R=[0]*n,[0]*n
L[0],R[-1]=A[0],A[-1]

from fractions import gcd

for i in range(1,n):
    L[i]=gcd(A[i],L[i-1])
for i in range(n-2,-1,-1):
    R[i]=gcd(A[i],R[i+1])

ans=max([L[-2],R[1]]+[gcd(L[i-1],R[i+1])for i in range(1,n-1)])
print(ans)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

import numpy as np
from itertools import product

n, m, x = map(int, readline().split())
ca = np.array(read().split(), np.int64).reshape((n, m + 1))
INF = 10 ** 9

c = ca[:, 0]
a = ca[:, 1:].T

ans = INF
for p_li in product([1, 0], repeat=n):
    p = np.array(p_li)
    rikai = a * p
    sm = rikai.sum(axis=1)
    if sm.min() >= x:
        cost = (c * p).sum()
        ans = min(ans, cost)

if ans == INF:
    ans = -1

print(ans)
# Judge status: Accepted
s = list(map(int, input().split()))
s.sort()

print(s[0]+s[1])
# Judge status: Accepted
def main():
    S = input()
    if S[-1] == "s":
        print(S + "es")
    else:
        print(S + "s")

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = []
A.append("shiritori")
for i in range(N):
  t = input()
  if t in A or i != 0 and t[0] != A[i][-1]:
    print('No')
    exit()
  else:
    A.append(t)
print('Yes')
# Judge status: Accepted
import numpy

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

lstMain = list()
for i in range(0, N):
    lstMain.append(list(map(int, input().split())))

count = 0
for i in range(0, N):
    for j in range(i+1, N):
        y = numpy.array(lstMain[i])
        z = numpy.array(lstMain[j])
        u = z - y
        distance = float(numpy.linalg.norm(u))
        if distance.is_integer():
            count += 1

print(count)
# Judge status: Accepted
N,M = map(int,input().split())

if N==1 and M==1:
    print(1)
elif N==1:
    print(M-2)
elif M==1:
    print(N-2)
else:
    print((N-2)*(M-2))
# Judge status: Accepted
X=int(input())

Q,R=divmod(X,11)

if R==0:
    K=0
elif 1<=R<=6:
    K=1
else:
    K=2

print(2*Q+K)
# Judge status: Accepted
N, K = map(int, input().split())
if N >= 2*K:
    s = N // K
    print(min(abs(N - s * K), abs(N- (s+1) * K)))
else:
    print(min(abs(N-K), abs(abs(N-K)-K)))
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(min(a,b))
# Judge status: Accepted
N = int(input())
pre = int(input())
ans = pre // 2
for _ in range(N - 1):
    i = int(input())
    if pre % 2 == 1 and i > 0:
        i -= 1
        ans += 1
    ans += i // 2
    pre = i
print(ans)
# Judge status: Accepted
N = int(input())

tmp = [[1]]
answer = tmp

for i in range(N - 1):
    tmp = []
    for a in answer:
        max_a = max(a)
        for j in range(1, max_a + 2):
            tmp.append(a + [j])
    answer = tmp

answer.sort()

def alpha(l):
    res = ""
    for ll in l:
        res += chr(ll + ord("a") - 1)
    return res

for a in answer:
    print(alpha(a))
# Judge status: Accepted
n = int(input())

num_sum = 0
max_num = 1
for i in range(n+1):
    num_sum += i
    if num_sum >= n:
        max_num = i
        break

for i in range(1, max_num+1):
    if i != num_sum - n:
        print(i)
# Judge status: Accepted
N=int(input())
print(2**(N.bit_length()-1))
# Judge status: Accepted
import math

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

ave = (a + b) / 2

print(math.ceil(ave))
# Judge status: Accepted
h, a = map(int, input().split())
if (h % a == 0):
    print(h // a)
else:
    print(h // a + 1)
# Judge status: Accepted
n=int(input())
p=[]
q=[]
for _ in range(n):
  x,y=map(int,input().split())
  p.append(x+y)
  q.append(x-y)
print(max(max(p)-min(p),max(q)-min(q)))
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))

money = 1000
stocks = 0

for i in range (0, N-1):
    if L[i+1] > L[i]:
        stocks = money//L[i]
        money = money%L[i]
    else:
        money+= stocks*L[i]
        stocks = 0

print(money+stocks*L[-1])
# Judge status: Accepted
n,a,b = map(int,input().split())
mod=7+10**9
ans = pow(2 , n , mod)

def comb(n,c,mod):
  s=1
  t=1
  for i in range(1,c+1):
    s=s*i%mod
  for j in range(n-c+1,n+1):
    t=t*j%mod
  return (t*pow(s,mod-2,mod))%mod

print((ans-1-comb(n,a,mod)-comb(n,b,mod))%mod)
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
print(['NO','YES'][b - a == c - b])
# Judge status: Accepted
n,m=[int(x) for x in input().split()]
h=[int(x) for x in input().split()]
t=[[]for i in range(n)]
ans=0
for i in range(m):
    a,b=[int(x) for x in input().split()]
    t[a-1].append(b-1)
    t[b-1].append(a-1)
for i in range(n):
    if t[i]==[]:
        ans+=1
    else:
        c=[]
        for j in t[i]:
            if h[i]<=h[j]:
                c.append(False)
        if c==[]:
            ans+=1
print(ans)
# Judge status: Wrong Answer
from math import factorial
import numpy as np
def comb(n, r):
	return factorial(n) // factorial(r) // factorial(n-r)

def ABC094D(n, a):
	a = sorted(a)[::-1]
	Max = comb(a[0], a[1])



n = int(input())
a = list(map(int, input().split()))
ABC094D(n, a)
# Judge status: Accepted
n, k = map(int, input().split())
s = input()
ans = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        ans += 1
print(min(n-1, ans + 2*k))
# Judge status: Wrong Answer
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n=int(input())
A=[(e,i) for i,e in enumerate(list(map(int,input().split())))]
print(A)
A.sort(key=lambda tup: tup[0])
print(A)
for e,i in A:
    print(e, i+1)
# Judge status: Wrong Answer
a, b = map(int, input().split())

ave = (a + b) / 2

if ave % 2 == 0:
  print(int(ave))
else:
  ave = int(ave)
  ave = ave + 1
  print(ave)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().strip().split()))

a=[a[n]-(n+1) for n in range(N)]
a.sort()
result=sum(a[N//2:N])-sum(a[:N//2]) if N%2==0 else sum(a[N//2+1:N])-sum(a[:N//2])
print(result)
# Judge status: Accepted
n,m=map(int,input().split())
ans=[0]*n

for i in range(m):
    a,b=map(int,input().split())
    ans[a-1]+=1
    ans[b-1]+=1

for j in range(n):
    print(ans[j])
# Judge status: Accepted
n,m,k=map(int,input().split())
ans=0
for i in range(0,n+1):
  for j in range(0,m+1):
    if m*i+(n-i*2)*j==k:
      ans=1
      break
  if ans==1:
    print("Yes")
    break
else:
  print("No")
# Judge status: Accepted
x,y = map(int,input().split())

if y == 100:
    y += 1
print((100**x)*y)
# Judge status: Accepted
s = input()
print(chr(ord(s)+1))
# Judge status: Accepted
H,N = map(int,input().split())
Ai = map(int, input().split())
 
if sum(Ai) >= H:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
MIN = 10**18
for i in range(1, N):
    val = 0
    a, b = i, N-i
    while a or b:
        x = a%10
        y = b%10
        val += (x+y)
        a //=10
        b //= 10
    MIN = min(MIN, val)

print(MIN)
# Judge status: Wrong Answer
k = int(input())

x = "7"
n = 10
c = 1
if k >=7:
    while n>0:
        if int(x) % k == 0 : 
            break
        c+=1
        x += "7"
        n-=1
print(c)
# 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: Wrong Answer
def check(array, string):
    for i in array:
        if i in string:
            return False
    return True

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

for i in range(1, 10001):
    if check(D, str(i)) and i >= N:
        print(i)
        exit(0)
# Judge status: Accepted
a = int(input())
print(1 if a==0 else 0)
# Judge status: Accepted
s = input()
s1 = int(s[:2])
s2 = int(s[2:])
m = range(1,13)
if s1 in m and s2 in m:
    print('AMBIGUOUS')
elif s1 in m:
    print('MMYY')
elif s2 in m:
    print('YYMM')
else:
    print('NA')
# Judge status: Accepted
n = int(input())
cost_paid = 800 * n
cost_saved = 200 * (n//15)

print(cost_paid - cost_saved)
# Judge status: Accepted
a=input().split()
if a.count('5') == 2:
    if a.count('7')==1:
        print('YES')
else:
    print('NO')
# Judge status: Accepted
s = input()
if not(('N' in s) ^ ('S' in s)) and not(('W' in s) ^ ('E' in s)):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

ans = []
for i in range(n):
    dis = []
    for j in range(m):
        dis.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))
    ans.append(dis.index(min(dis)) + 1)
for i in ans:
    print(i)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
print('Yes') if abs(a-c) <= d or abs(a-b) <= d and abs(b-c) <= d else print('No')
# Judge status: Wrong Answer
def main():
    n = list(input())[-1]
    if n in [2, 4, 5, 7, 9]:
        ans = 'hon'
    elif n in [0, 1, 6, 8]:
        ans = 'pon'
    else:
        ans = 'bon'
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
list = [input() for i in range(2)]

s = list[0]
t = list[1]
lens = len(s)
lent = len(t)
if s in t and lent-lens==1 and 1<=lens<=10:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
c=Counter(a).items()
f=0
s=0
for k,v in c:
    if v>=4:
        if k>f:
            s=k
            f=k
        elif k>s:
            s=k
    if v>=2:
        if k>f:
            s=f
            f=k
        elif k>s:
            s=k

print(s*f)
# Judge status: Accepted
n,a,b = [int(x) for x in input().split()]
print((n//(a+b))*a + min(n % (a+b), a))
# Judge status: Accepted
x = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import numpy as np
S = list(input())
N = len(S)
A = []
B = []
for i in range((N-1)//2):
    A.append(S[i])
for j in range((N-1)//2):
    B.append(S[((N+3)//2)+(j-1)])

C = list(reversed(A))
D = list(reversed(B))
E = list(reversed(S))

if np.count_nonzero(np.array(A) == np.array(C)) == np.count_nonzero(np.array(B) == np.array(D)) == len(A) and np.count_nonzero(np.array(S) == np.array(E)) == len(S):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
A,B=map(int,input().split())
lcm=A*B/math.gcd(A,B)
print(int(lcm))
# Judge status: Wrong Answer
n = int(input())
s = [list(input()) for i in range(n)]
cnt_dic = {}
sum_cnt = 0
for i in range(n):
    s[i].sort()
    if str(s[i]) in cnt_dic:
        cnt_dic[str(s[i])] = cnt_dic[str(s[i])] + 1
    else:
        cnt_dic[str(s[i])] = 1

for i in range(len(cnt_dic)):
    sum_cnt += int((cnt_dic[str(s[i])] * (cnt_dic[str(s[i])] - 1) )/ 2)



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

# check
l, r = N // 2 - 1, N // 2
sort_x = sorted(X)
lx, rx = sort_x[l], sort_x[r]
for ind in range(N):
    target = X[ind]
    if target <= lx:
        print(rx)
    if target >= rx:
        print(lx)
# Judge status: Accepted
import numpy as np
N, D = map(int, input().split())
x = []
for i in range(N):
  x.append(list(map(int, input().split())))
x = np.array(x)
ans = 0
for i in range(N-1):
  for j in range(i+1,N):
    tmp = sum((x[i]-x[j])**2)
    for k in range(1,tmp+1):
      if tmp == k**2:
        ans += 1
        break
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

newa = []

for num in a:
    newa.append(num)
    newa.append(num)

newa.sort(reverse=True)

ans=sum(newa[1:n])

print(ans)
# Judge status: Accepted
# そうか、長方形の中心を通れば全ての長方形を二等分できるのか
W,H,x,y = map(int,input().split())
if W / 2 == x and H / 2 == y:
    ans = 1
else:
    ans = 0
print(W*H/2,ans)
# Judge status: Accepted
a,b=list(map(str,input().split()))
s,t=map(int,input().split())
u=str(input())

if u == a:
    print(s-1,t)
else:
    print(s,t-1)
# Judge status: Accepted
from bisect import bisect_right
from itertools import accumulate

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

a_ac=[0]+list(accumulate(a))
b_ac=[0]+list(accumulate(b))

ans=0
for i in range(n+1):
  remain=k-a_ac[i]
  if remain<0:
    continue
  t_ans=i
  t_ans+=bisect_right(b_ac,remain)-1
  ans=max(ans,t_ans)

print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a>b:
  a-=1
print(a)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(c-a) <= d:
    print('Yes')
else:
    if abs(a-b) <= d and abs(b-c) <= d:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
import sys
n, m = map(int, input().split())
num = [-1]*n

if n == 1 and m == 0:
  print(0)
  sys.exit()

for _ in range(m):
  s, c = map(int, input().split())

  # 一桁目が0
  if s == 1 and c == 0 and n > 1:
    print(-1)
    sys.exit()
  # 同じ桁が指定される
  if num[s-1] != -1 and num[s-1] != c:
    print(-1)
    sys.exit()
  num[s-1] = c

if num[0] == -1:
  num[0] = 1
for i in range(1, n):
  if num[i] == -1:
    num[i] = 0

for i in num:
  print(i, end='')
# Judge status: Accepted
S = input().split()[0]

l = list(S)
s=""
for i in l:
  s+="x"
print(s)
# Judge status: Accepted
n=int(input())
l=list(map(int, input().split()))
st=l[n-1]
for _ in reversed(l):
  if _-1>st:
    print("No")
    exit()
  elif _-1==st:
    st==_-1
  else:
    st=_
print("Yes")
# Judge status: Accepted
N = int(input())

x = N*800 - (N//15)*200
print(x)
# Judge status: Accepted
from collections import Counter
n,m = map(int,input().split())
a_ls = list(map(int, input().split()))
counter = Counter(a_ls)
for i in range(m):
    b,c = map(int,input().split())
    counter[c] += b

cards = sorted(counter.items(), key = lambda x:x[0], reverse=True)
rest = n
Sum = 0
for num, count in cards:
    if count < rest:
        Sum += num * count
        rest -= count
    else:
        Sum += rest * num
        break
print(Sum)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = [0] * n
for i in range(n):
    b[a[i]-1] = i+1

print(*b)
# Judge status: Accepted
def prime(p):
    memo = []
    for i in range(2,(int(p**0.5)+1)):
        while p%i==0:
            p //= i
            memo.append(i)
    if p != 1:
        memo.append(p)
    return memo

import collections

n=int(input())

memo = prime(n)

memo = collections.Counter(memo)

memo = sorted(memo.items(), key=lambda x:-x[1])

ans = 0

for sosu, count in memo:
  kosu = 1
  while 0 <= count-kosu:
    count -= kosu
    ans += 1
    kosu += 1
print(ans)
# Judge status: Wrong Answer
s = input()
l = len(s)
cnt = 0
ls = []
ls.append(0)
ls.append(0)
for i in range(l):
    ls.append(int(s[i]))
for i in range(l+1):#下から回す
    if 6<= ls[-i-1] <=10:
        ls[-i-1] = 10 -ls[-i-1] #おつりを代入
        ls[-i-2] += 1 #繰り上がり
print(sum(ls))
# Judge status: Accepted
S = input()
D = {}
for i in S:
  if i in D:
    D[i] += 1
    D[i] %= 2
  else:
    D[i] = 1
if sum(D[i] for i in D) == 0:
  print("Yes")
else:
  print("No")