Harryxun/stf_run huggingface dataset:
N,A,B=map(int,input().split())

if(A>B):
  ans1=B
  ans2=A-(N-B)
else:
  ans1=A
  ans2=B-(N-A)
  
print(ans1+" "+ans2)

### FIXED CODE ###

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

if(A>B):
  ans1=B
  ans2=max(0,A-(N-B))
else:
  ans1=A
  ans2=max(0,B-(N-A))
  
print(str(ans1)+" "+str(ans2))
# import itertools
# import pprint
import copy
from collections import deque

gem,ope = map(int,input().split())
vlist = deque(map(int,input().split()))

ans = 0

for l in range(ope+1):
  for r in range(ope-l+1):
    if l+r>ope:
      break

    x   = ope-l-r
    now = []
    deq = copy.deepcopy(vlist) 

    for i in range(l):
      now.append(deq.popleft())
    for j in range(r):
      now.append(deq.pop())
    for k in range(x):
      if now==[]:
        break
      if min(now)<0:
        now.remove(min(now))
    
    if ans<sum(now):
      ans = sum(now)

print(ans)


### FIXED CODE ###

# import itertools
# import pprint
import copy
from collections import deque

gem,ope = map(int,input().split())
vlist = deque(map(int,input().split()))

ans = 0

for l in range(ope+1):
  for r in range(ope-l+1):
    if l+r>ope or l+r>gem:
      break

    x   = ope-l-r
    now = []
    deq = copy.copy(vlist) 

    for i in range(l):
      now.append(deq.popleft())
    for j in range(r):
      now.append(deq.pop())
    for k in range(x):
      if now==[]:
        break
      if min(now)<0:
        now.remove(min(now))
    
    if ans<sum(now):
      ans = sum(now)

print(ans)
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

V *= T
W *= T

if (A < 0 and B < 0) or (A > 0 and B > 0):
    D = max(A, B) - min(A, B)
elif (A > 0 and B < 0) or (A < 0 and B > 0):
    D = max(A, B) + abs(min(A, B))

check = D + W - V

if check > 0:
    print('NO')
else:
    print('YES')

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if abs(A - B) <= (V - W) * T:
    print('YES')
else:
    print('NO')
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse = True)
q.sort(reverse = True)
r.sort(reverse = True)
pp = p[:x]
qq = q[:y]
if x+y <= c:
  rr = r[:(x+y)]
else:
  rr = r
ppqq = pp + qq
ppqq.sort()
for i in range(len(ppqq)):
  if ppqq[i] < rr[0]:
    ppqq[i] = rr[0]
    del rr[0]
print(sum(ppqq))

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse = True)
q.sort(reverse = True)
r.sort(reverse = True)
pp = p[:x]
qq = q[:y]
if x+y <= c:
  rr = r[:(x+y)]
else:
  rr = r
ppqqrr = pp + qq + rr
ppqqrr.sort(reverse = True)
print(sum(ppqqrr[:x+y]))
b = str(input())
if b = "A":
    print("T")
elif b = "T":
    print("A")
elif b = "C":
    print("G")
elif b = "G":
    print("C")

### FIXED CODE ###

b = str(input())
if b == "A":
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
elif b == "G":
    print("C")
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)

ans = 0
for i in range(M):
    if A[CB[i][1]-1] < CB[i][0]:
        ans += CB[i][0] * CB[i][1]
        for j in range(CB[i][1]):
            A.pop(0)
    else:
        for j in range(CB[i][1]):
            if A[0] < CB[i][0]:
                ans += CB[i][0]
                A.pop(0)
                continue
            else:
                ans += sum(A)
                A = []
                break
        break

if len(A) != 0:
    ans += sum(A)

print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
X = [0 for i in range(N)]
CB = []
for i in range(M):
    b,c = map(int,input().split())
    CB.append([c,b])
CB.sort(reverse=True)
#print(CB)
index = 0
for i in range(M):
    for j in range(CB[i][1]):
        A[index] = max(A[index],CB[i][0])
        if index != N - 1:
            index += 1
            continue
        else:
            print(sum(A))
            exit()
print(sum(A))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
  def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)

A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)

koyaku_insu = prime_factorize(koyaku)


print(len(koyaku_insu))

### FIXED CODE ###

def prime_factorize(n):
    a = [1]
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def gcd(x,y):
    if y == 0:
       return x
    else:
       return gcd(y, x % y)
 
A,B = [int(x) for x in input().split()]
koyaku = gcd(A,B)
 
koyaku_insu = list(set(prime_factorize(koyaku)))
 
 
print(len(koyaku_insu))
A = map(int, input().split(" "))
print([10, 0][A[0] < A[1]])

### FIXED CODE ###

A = list(map(int, input().split(" ")))
print([10, 0][A[0] < A[1]])
N=int(input())
if N in [2,4,5,7,9]: print(N+str(N)+'hon')
elif N in [0,1,6,8]: print(N+str(N)+'pon')
else: print(N+str(N)+'bon')

### FIXED CODE ###

N=input()
if int(N[len(N)-1]) in [2,4,5,7,9]: print('hon')
elif int(N[len(N)-1]) in [0,1,6,8]: print('pon')
else: print('bon')
a, b = map(int,input().split())

p1 = int(a // 0.08 + 1)
p2 = int(b // 0.1 + 1)

p1_list = [i for i in range(p1,p1+13)]
p2_list = [i for i in range(p2,p2+10)]

p_list = set(p1_list) & set(p2_list)

p_list = list(p_list)
p_list = sorted(p_list)

print(p_list[0])

### FIXED CODE ###

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

for i in range(1,10001):
    if (i*0.08)//1==a and (i*0.1)//1==b:
        print(i)
        exit()
print(-1)
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
from heapq import heappush,heappop,heapify

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(W) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[(1,1),(-1,1),(1,-1),(-1,-1),(2,0),(-2,0),(0,2),(0,-2),(1,2),(-1,2),(1,-2),(-1,-2),(2,1),(-2,1),(2,-1),(-2,-1),(2,2),(-2,2),(2,-2),(-2,-2)]

d=defaultdict(lambda: float("inf"))    #(h,w):kyori スタート地点からその点までの距離

def dij(h,w):
    d[(h,w)]=0
    hq=[]
    heappush(hq,(0,h,w))
    while hq:
        cost,fro_h,fro_w=heappop(hq)
        #歩いて移動
        for dh,dw in D:
            to_h, to_w=fro_h+dh, fro_w+dw
            if 0<=to_h<H and 0<=to_w<W:
                if S[to_h][to_w]==".":
                    alt=d[(fro_h,fro_w)]+0
                    if alt<d[(to_h,to_w)]:
                        d[(to_h,to_w)]=alt
                        heappush(hq, (alt,to_h,to_w))
        #ワープ
        for dh,dw in WARP:
            to_h, to_w=fro_h+dh, fro_w+dw
            if 0<=to_h<H and 0<=to_w<W:
                if S[to_h][to_w]==".":
                    alt=d[(fro_h,fro_w)]+1
                    if alt<d[(to_h,to_w)]:
                        d[(to_h,to_w)]=alt
                        heappush(hq, (alt,to_h,to_w))

dij(CH,CW)
if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import defaultdict, deque

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(H) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[]
for dh in range(-2,3):
    for dw in range(-2,3):
        if abs(dh)+abs(dw)<=1: continue
        WARP.append((dh,dw))

d=defaultdict(lambda: float("inf")) #スタート地点から各マスまでの距離

q=deque()
q.append((0,CH,CW))
d[(CH,CW)]=0

while q:
    kyori, fro_h, fro_w=q.popleft()
    if d[(fro_h, fro_w)]<kyori: continue
    #歩いて移動
    for dh,dw in D:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori
                q.appendleft((kyori, to_h, to_w))
    #ワープ
    for dh,dw in WARP:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori+1 < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori+1
                q.append((kyori+1, to_h, to_w))

if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
visited = [0] * n
f = True
visited[0] = 1
index = 0
memo = [0]
while f:
    index = a[index] - 1
    if visited[index]:
        v = index
        break
    memo.append(index)
    visited[index] = 1
f = False
list_ = []
for i in range(len(memo)):
    if not (f) and memo[i] == v:
        f = True
        list_.append(memo[i])
    if f:
        list_.append(memo[i])
if k + 1 > len(memo):
    k -= len(memo)
    if (k + 1) % len(list_) == 0:
        i = len(list_) - 1
    else:
        i = (k + 1) % len(list_) - 1
    print(memo[i] + 1)
else:
    print(memo[k + 1] + 1)


### FIXED CODE ###

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
memo = []
memo_cir = []
visited = [False] * n
index = 0
flag = True
while flag:
    if visited[index]:
        flag = False
    else:
        memo.append(index)
        visited[index] = True
        index = a[index] - 1
flag = False
for i_ in memo:
    if i_ == index:
        flag = True
    if flag:
        memo_cir.append(i_)
if k + 1 >= (len(memo) - len(memo_cir)):
    k -= (len(memo) - len(memo_cir) - 1)
    print(memo_cir[(k % len(memo_cir)) - 1] + 1)
else:
    print(memo[k] + 1)
a

### FIXED CODE ###

R = (int)(input())
G = (int)(input())
answer = 2 * G - R
print(answer)
import numpy as np
from functools import lru_cache

A, B, Q = map(int, input().split())
adisps = np.array([int(input()) for _ in range(A)])
bdisps = np.array([int(input()) for _ in range(B)])
qdisps = np.array([int(input()) for _ in range(Q)])

@lru_cache(maxsize=100000)
def nearest(now, flag):
    disps = adisps if flag == 0 else bdisps
    idx = np.argmin(np.abs(disps - now))
    nearest_point = disps[idx]
    cost = np.abs(now - nearest_point)
    return nearest_point, cost

for qdisp in qdisps:

    #A→B
    pos_a1, cost_a1 = nearest(qdisp, 0)
    pos_b1, cost_b1 = nearest(pos_a1, 1)
    cost1 = cost_a1 + cost_b1

    #B→A
    pos_b2, cost_b2 = nearest(qdisp, 1)
    pos_a2, cost_a2 = nearest(pos_b2, 0)
    cost2 = cost_a2 + cost_b2

    ans = min(cost1, cost2)
    print(ans)

### FIXED CODE ###

import numpy as np
y, m, d = map(int, input().split("/"))

if y > 2019:
    print("TBD")
elif m > 4:
    print("TBD")
elif d > 30:
    print("TBD")
else:
    print("Heisei")
import sys
input = sys.stdin.readline
import math


def read():
    N = int(input().strip())
    X = input().strip()
    return N, X


def strdiv(X, k, d):
    P = 0
    q = 0
    for i in range(len(X)):
        q <<= 1
        if i == k:
            q |= 1-int(X[i])
        else:
            q |= int(X[i])
        p, q = divmod(q, d)
        # 商
        P <<= 1
        P |= p
    return P, q


def solve(N, X):
    B = sum([1 for a in X if a == "1"])
    if B == 0:
        return 0
    for k in range(N):
        if X[k] == "0":
            b = (B + 1)
        else:
            b = (B - 1)
        ans = 0
        x = X
        q = 1
        while q > 0:
            p, q = strdiv(x, k, b)
            ans += 1
            x = bin(q)[2:]
            b = sum([1 for a in x if a == "1"])
            k = -1
        print(ans)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


### FIXED CODE ###

import sys
input = sys.stdin.readline
import math


def read():
    N = int(input().strip())
    X = input().strip()
    return N, X


def bitdiv(N:int, X:str, d:int):
    q = 0
    for i in range(N):
        q <<= 1
        q |= int(X[i])
        p, q = divmod(q, d)
    return q


def solve(N, X):
    BP = [0 for i in range(N)]
    BM = [0 for i in range(N)]

    c = X.count("1")
    

    # 2^k mod (c+1) を高速に求める
    qp = bitdiv(N, X, c+1)
    BP[N-1] = 1 % (c+1)
    for i in range(N-2, -1, -1):
        BP[i] = (BP[i+1] * 2) % (c+1)
    
    # 2^k mod (c-1) を高速に求める
    if c > 1:
        qm = bitdiv(N, X, c-1)
        BM[N-1] = 1 % (c-1)
        for i in range(N-2, -1, -1):
            BM[i] = (BM[i+1] * 2) % (c-1)

    for i in range(N):
        q = 0
        ans = 0
        if X[i] == "0":
            # X_i \equiv (X + 2^i)
            q = (qp + BP[i]) % (c+1)
            ans += 1
        elif X[i] == "1" and c > 1:
            # X_i \equiv (X - 2^i)
            q = (qm - BM[i]) % (c-1)
            ans += 1
        else:
            q = 0
            ans = 0
        while q > 0:
            q %= (bin(q).count("1"))
            ans += 1
        print(ans)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
N,H,W=[input() for i in range(3)]
print((N-H+1)*(N-W+1))

### FIXED CODE ###

N,H,W=[int(input()) for i in range(3)]
print((N-H+1)*(N-W+1))
hlst10 = [j for j in range(2 ** h)]
hlst2 = [format(k, '0{}b'.format(h)) for k in hlst10]
#print(hlst2)

wlst10 = [l for l in range(2 ** w)]
wlst2 = [format(m, '0{}b'.format(w)) for m in wlst10]
#print(wlst2)

ans = 0
for o in hlst10:
	for p in wlst10:
		black = 0
		nowhlst = hlst2[o]
		nowwlst = wlst2[p]
		for q in range(h):
			for r in range(w):
				if nowhlst[q] == '0' and nowwlst[r] == '0' and test[q][r] == "#":
					black += 1
		if black == n:
			ans += 1 
print(ans)

### FIXED CODE ###

h, w, n = map(int, input().split())
test = [input() for i in range(h)]
ans = 0
for binh in range(2 ** h):
	for binw in range(2 ** w):
		tmp = 0
		for l in range(h):
			for m in range(w):
				if ((binh >> l) & 1) == 0  and ((binw >> m) & 1) == 0 and test[l][m] == "#":
					tmp += 1
		if tmp == n:
			ans += 1	
print(ans)
a,b,x = map(int,input().split())
if x >= 1/2 * (a*a*b):
    theta = arctan(2(a*a*b-x)/(a*a*a))
else:
    theta = 90 - arctan(2x/(a*b*b))
print(theta)

### FIXED CODE ###

import math
a,b,x = map(int,input().split())
y = math.pi
if x >= 1/2 * (a*a*b):
    theta = math.atan(2*(a*a*b-x)/(a*a*a))
else:
    theta = y/2 - math.atan(2*x/(a*b*b))
print(theta*180/y)
n = int(input())
 
a = n%1000
b = 1000-a
if b=1000:
  print(0)
else:
  print(b)

### FIXED CODE ###

n = int(input())
 
a = n%1000
b = 1000-a
if b==1000:
  print(0)
else:
  print(b)
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:14:17 2020

@author: Admin
"""


n,x,m=input().split()
m=int(m)
a=[int(x)]
for i in range(1,int(n)):
    zp=a[i-1]
    z=zp**2
    a.append(z%m)
    
print(sum(a))

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 13:03:22 2020

@author: Admin
"""

a=input()
if a[-1]=='s':
    print(a+'es')
else:
    print(a+'s')
n = int(input())
p = [map(int, input()) for i in range(n)]

print(sum(p)-int(max(d)/2))

### FIXED CODE ###

n = int(input())
p = list(map(int, [input() for i in range(n)]))

print(int(sum(p)-max(p)/2))
import numpy as np
from numba import njit, i8

h, w, d = map(int, input().split())
arr = np.zeros([h, w], dtype=np.int64)

for i in range(h):
    arr[i] = list(map(int, input().split()))

q = int(input())
lr = np.zeros([q, 2], dtype=np.int64)

for i in range(q):
    lr[i] = list(map(int, input().split()))


@njit
def solve(arr, lr, d):
    ans = []
    for l, r in lr:
        score = 0
        while l != r:
            tmp = l + d
            u = np.where(arr == l)
            v = np.where(arr == tmp)
            score += (abs(v[0][0] - u[0][0]) + abs(v[1][0] - u[1][0]))
            l += d
        ans.append(score)
    return ans


print(*solve(arr, lr, d), sep="\n")

### FIXED CODE ###

h, w, d = map(int, input().split())
arr = [0] * (h * w + 1)

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

for i in range(h):
    for j in range(w):
        s = a[i][j]
        arr[s] = (i, j)

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

cnt = h * w
result = [[0] for _ in range(d)]
for i in range(d):
    l = i
    score = 0
    while l + d <= cnt:
        if l == 0:
            result[i].append(score)
            l += d
            continue
        (ux, uy) = arr[l]
        (vx, vy) = arr[l + d]
        score += (abs(vx - ux) + abs(vy - uy))
        result[i].append(score)
        l += d


for l, r in lr:
    ans = result[l % d]
    print(ans[r // d] - ans[l // d])
a, b, x = map(int. input().split())
if a <= x and x <= a + b:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a, b, x = map(int, input().split())
if a <= x and x <= a + b:
  print("YES")
else:
  print("NO")
n,m = map(int,input().split())
a = list(range(m+2))
a[0] = -1
a[m+1] = n+1
ans = 1
if m == 0:
    x = a[m+1]-a[i]-1
    ans = int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007
else:
  for i in range(m):
  	a[i+1] = int(input())
  for i in range(m+1):
    if a[i]+1 == a[i+1] and i != 0 and i != m:
      ans = 0
      break
    else:
      x = a[i+1]-a[i]-1
      ans = ans * int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007

print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
b = [] 
for i in range(n+1):
  if i == 0 or i == 1:
    b.append(1)
  else:
    b.append(b[i-2]+b[i-1])

ans = 1
if m != 0:
  a = list(range(m))
  for i in range(m):
    a[i] = int(input())
    if i == 0:
      ans = ans*b[a[i]-1]%1000000007
    else:
      if a[i] == a[i-1]+1:
        ans = 0
      else:
        ans = ans*b[a[i]-a[i-1]-2]%1000000007
  ans = ans*b[n-a[m-1]-1]%1000000007
  print(ans)
else:
  print(b[n]%1000000007)
import sys
input = sys.stdin.readline
Q = int(input())
AB = [list(map(int,input().split())) for i in range(Q)]

for A,B in AB:
    M = A*B
    A,B = sorted([A,B])
    ans = 0
    i = 1
    b = int(pow(M,0.5))
    if b == B:
        b -= 1
    #print(A,B,b)
    ans += (M-1)//b - A
    ans += b-1
    ans += A-1
    print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
Q = int(input())
AB = [list(map(int,input().split())) for i in range(Q)]

small_case = {(1,1):0, (1,2):0}
for A,B in AB:
    M = A*B
    A,B = sorted([A,B])
    if (A,B) in small_case:
        print(small_case[(A,B)])
        continue
    ans = 0
    i = 1
    b = int(pow(M,0.5))
    if b == B:
        b -= 1
    ans += (M-1)//b - A
    ans += b-1
    ans += A-1
    print(ans)
s = input()
dic = {}
flag = False

for key in s:
  if key not in dic:
    dic[key] = 0
  dic[key] += 1

for k, v in dic.items():
  if len(s) % 2 == 0:
    if v > len(s)/2:
      answ = k
      flag = True
  elif len(s) % 2 == 1:
    if v >= len(s)/2:
      answ = k
      flag = True
    
if flag == False:
  print(-1, -1)

start = s.find(answ)+1
end = s.rfind(answ)+1
print(start, end)

### FIXED CODE ###

def solve(s):
  for i in range(len(s)-1):
    if s[i] == s[i+1]:
      return '{0} {1}'.format(i+1, i+2)
  for i in range(len(s)-2):
    if s[i] == s[i+2]:
      return '{0} {1}'.format(i+1, i+3)
  return '{0} {1}'.format(-1, -1)

print(solve(input()))
N,A,B = map(int, input().split())

list_ab = []
list_b = ['b']*A
list_ab.extend(list_b)
list_a = ['a']*B
list_ab.extend(list_a)


count = (N//(A+B)+1)
str = list_ab*count


str = str[:N]
if str.count('b') != 0:
    print(str.count('b'))
else:
    print('0')


### FIXED CODE ###

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

count = N//(A+B)
if (N-count*(A+B))>A:
    print(count*A+A)
else:
    print(count*A+(N-count*(A+B)))
W,H,x,y = (int(i) for i in input().split())

is_double = 0
if x == W//2 and y == H//2:
    is_double = 1

if x>=W//2:
    res = (W-x)*H
else:
    res = x*H

if y>=H//2:
    res2 = (H-y)*W
else:
    res2 = y*W

if x==y*W/H or x==(H-y)*W/H:
    res3 = H*W/2

print("{} {}".format(max([res,res2,res3]),is_double))

### FIXED CODE ###

W,H,x,y = (int(i) for i in input().split())

is_double = 0
if x == W/2 and y == H/2:
    is_double = 1

print("{} {}".format(H*W/2,is_double))
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
max = -9999999999  
for i in range(1, 2**10):
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        sum += P[j][count]
    max = max(max, sum)  
print(max)

### FIXED CODE ###

N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
m = -9999999999  
for i in range(1, 2**10):
    s = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        s += P[j][count]
    m = max(m, s)  
print(m)
s=input()

print(min([abs(int(s[i]+s[i+1]+s[i+2])-753) for i in range(len(s)-3)]))

### FIXED CODE ###

x = int(input())

if x == 7 or x == 5 or x == 3:
    print("YES")
else:
    print("NO")
!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
 import sys
 
 for line in sys.stdin:
     card = line.split(" ")
 
     if card[0] > card[1]:
        print("Alice")
    elif card[0] < card[1]:
        print("Bob")
    else:
        print("Draw")

### FIXED CODE ###

import sys
 
for line in sys.stdin:
    card = line.split(" ")
    alice = int(card[0])
    bob = int(card[1])
    if alice == 1:
        alice += 13
    if bob == 1:
        bob += 13
        
    if alice > bob:
        print("Alice")
    elif alice < bob:
        print("Bob")
    else:
        print("Draw")
n = input()
a = {}
for i in range(1,int(n)+1):
    a[i] = int(input())

result = 0
for i in range(1,int(n)+1):
    if a[a[i]] == i:
        result = result+1
print(result/2)

### FIXED CODE ###

n = input()
a = input()
a = a.split(sep=' ')

result = 0
for i in range(1,int(n)+1):
    if int(a[int(a[i-1])-1]) == i:
        result = result+1
result = int(result/2)
print(result)
N,H = map(int,input().split())
a_list=[]
b_list=[]
cnt = 0
for i in range(N):
  a,b = map(int,input().split())
  a_list.append(a)
  b_list.append(b)
sum_b = sum(b_list)
if sum_b < H:
  A = max(a_list)
  for i in range(N):
    if b_list[i] - A < 0:
      cnt += A - b_list[i]
  print(N-(-(H - sum_b - cnt)//A))
else:
  c = sorted(b_list)
  i = 0
  k = 0
  while k < H:
    k += c[N-1-i]
    i += 1
  pprint(i)

### FIXED CODE ###

a = []
b = []
N,H = map(int,input().split())
for i in range(N):
    ca,cb = map(int,input().split())
    a.append(ca)
    b.append(cb)
count = 0
ma = max(a)
b.sort(reverse = True)
def ans():
    global N,H,count
    for i in range(N):
        if b[i] < ma:
            break
        H -= b[i]
        count += 1
        if H <= 0:
            return count
    count += H//ma
    if H%ma != 0:
        count += 1
    return count
print(ans())
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
XY = []
for _ in range(N):
    x, y = mapint()
    XY.append((x, y))

from collections import defaultdict, Counter
dic = []
for i in range(N):
    x1, y1 = XY[i]
    for j in range(N):
        if i==j:
            continue
        x2, y2 = XY[j]
        dx, dy = x2-x1, y2-y1
        if dx==0 and dy==0:
            continue
        dic.append((dx, dy))
c = Counter(dic)
(x, y), cnt = c.most_common()[0]
print(N-cnt)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
XY = []
for _ in range(N):
    x, y = mapint()
    XY.append((x, y))

from collections import defaultdict, Counter
dic = []
for i in range(N):
    x1, y1 = XY[i]
    for j in range(N):
        if i==j:
            continue
        x2, y2 = XY[j]
        dx, dy = x2-x1, y2-y1
        if dx==0 and dy==0:
            continue
        dic.append((dx, dy))
c = Counter(dic)
if len(c)==0:
    print(N)
else:
    (x, y), cnt = c.most_common()[0]
    print(N-cnt)