Problem:


Score : 100 points

Problem Statement

We conducted a survey on newspaper subscriptions.
More specifically, we asked each of the N respondents the following two questions:

Question 1: Are you subscribing to Newspaper X?

Question 2: Are you subscribing to Newspaper Y?

As the result, A respondents answered "yes" to Question 1, and B respondents answered "yes" to Question 2.

What are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?

Write a program to answer this question.

Constraints

1 \leq N \leq 100

0 \leq A \leq N

0 \leq B \leq N

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N A B

Output

Print the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.

Sample Input 1

10 3 5

Sample Output 1

3 0

In this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 3 and at least 0.

Sample Input 2

10 7 5

Sample Output 2

5 2

In this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.

Here, the number of respondents subscribing to both newspapers is at most 5 and at least 2.

Sample Input 3

100 100 100

Sample Output 3

100 100



Sample input:
10 3 5


Sample output:
3 0

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, a, b = input().split()
    N, A, B = int(n), int(a), int(b)

    ans_max = min(A, B)

    n_mid = N / 2
    if (A + B) <= N:
        ans_min = 0
    else:
        ans_min = max((A - n_mid) + (B - n_mid), 0)

    print('{0} {1}'.format(ans_max, ans_min))

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,raw_input().split())
m=A+B
if A==B==N:
	print N,N
elif(m>N):
	if A==B:
		print A,1
	else:
		print min(A,B),abs(A-B)
else:
	print min(A,B),0

Submission status: Wrong Answer

Solution code:
n, a, b=map(int, input().split())
 
print(min(max(a,b),n),max(0,a+b-n))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, a, b = input().split()
    N, A, B = int(n), int(a), int(b)

    ans_max = min(A, B)

    n_mid = N / 2
    if A <= (n_mid) and B <= (n_mid):
        ans_min = 0
    else:
        ans_min = max((A - n_mid) + (B - n_mid), 0)

    print('{0} {1}'.format(ans_max, ans_min))

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,raw_input().split())
m=A+B
if A==B==N:
	print N,N
elif(m>N):
	print min(A,B),abs(A-B)
else:
	print min(A,B),0

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, a, b = input().split()
    N, A, B = int(n), int(a), int(b)

    ans_max = min(A, B)

    n_mid = N // 2
    if A <= (n_mid) and B <= (n_mid):
        ans_min = 0
    else:
        ans_min = max((A - n_mid) + (B - n_mid), 0)

    print('{0} {1}'.format(ans_max, ans_min))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == n or b == n:
    min_num = min(a,b)
    max_num = min(a,b)
elif a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n <= a + b:
    min_num = abs(int(n/2)-max(a,b))
    max_num = min(a,b)
elif n >= a + b:
    max_num = min(a,b)


print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,raw_input().split())
m=A+B
if A==B==N:
	print N,N
elif(m>=N):
	print min(A,B),abs(A-B)
else:
	print min(A,B),0

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == n or b == n:
    min_num = min(a,b)
    max_num = min(a,b)
elif a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    max_num = min(a,b)
elif n < a + b:
    min_num = abs(int(n/2)-max(a,b))
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n, a, b = input().split()
    N, A, B = int(n), int(a), int(b)

    ans_max = min(A, B)

    n_mid = N // 2
    if A <= (n_mid) and B <= (n_mid):
        ans_min = 0
    else:
        ans_min = (A - n_mid) + (B - n_mid)

    print('{0} {1}'.format(ans_max, ans_min))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == n or b == n:
    min_num = min(a,b)
    max_num = min(a,b)
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    max_num = min(a,b)
elif n < a + b:
    min_num = abs(int(n/2)-max(a,b))
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

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

print(max(a,b),max(0,a+b-n))

Submission status: Wrong Answer

Solution code:
data_list = list(map(int, input().split()))

n = data_list[0]
x = data_list[1]
y = data_list[2]

if n == x == y:
    print(n, n)
    exit(0)

if n - (x + y) >= 0:
    print(min(x, y), 0)
else:
    print(min(x, y), abs(x - y))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    max_num = min(a,b)
elif n < a + b:
    min_num = abs(int(n/2)-max(a,b))
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    max_num = min(a,b)
elif n <= a+ b:
    if a == b:
        min_num = abs(int(n/2)-a)
        max_num = a
    else:
        min_num = abs(a-b)
        max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n > a + b:
    if a == b:
        min_num = 0
        max_num = a
    else:
        min_num = 0
        max_num = min(a,b)
elif n < a+ b:
    if a == b:
        min_num = abs(int(n/2)-a)
        max_num = a
    else:
        min_num = abs(a-b)
        max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    data = input().split()
    data = [int(s) for s in data]
    outputmax = min(data)
    if data[0] == data[1] == data[2]:
        outputmin = data[1]
    elif data[0] == (data[1] + data[2]):
        outputmax = 0
        outputmin = 0
    elif data[0] < (data[1] + data[2]):
        outputmin = max(data[1],data[2]) - min(data[1],data[2]) 
    else:
        outputmin = 0
    print(str(outputmax) + " " + str(outputmin))

Submission status: Wrong Answer

Solution code:
l = map(int, raw_input().split())
if l[1] < l[2]:
  l[1], l[2] = l[2], l[1]
if l[1] <= -(-l[0]//2):
  minp = 0
else:
  minp = l[1] + l[2] -l[0]
print l[2],
print minp

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    data = input().split()
    data = [int(s) for s in data]
    if data[0] == data[1] == data[2]:
        outputmin = data[1]
    elif data[0] < (data[1] + data[2]):
        outputmin = max(data[1],data[2]) - min(data[1],data[2]) 
    else:
        outputmin = 0
    outoutmax = min(data)
    print(str(outoutmax) + " " + str(outputmin))

Submission status: Wrong Answer

Solution code:
total, a, b = map(int, input().split())
if a > b:
    max_num = b
    if total < (a+b):
        min_num = abs(a - b)
    else:
        min_num = 0
elif a == b:
    min_num = a
    max_num = b
else:
    max_num = a
    if total < (a+b):
        min_num = abs(a - b)
    else:
        min_num = 0

print(int(max_num), int(min_num))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math

args = input().split()

n = args[0]
a = args[1]
b = args[2]

n = int(n)
a = int(a)
b = int(b)

reta = a
retb = (n - a) - b
if retb > 0 :
    retb = 0
else:
    retb = abs(retb)

print('{reta} {retb}'.format(reta=reta,retb=retb))

sys.exit(0)

Submission status: Wrong Answer

Solution code:
l = map(int, raw_input().split())
if l[1] < l[2]:
  l[1], l[2] = l[2], l[1]
if l[1] <= l[0]/2:
  minp = 0
else:
  minp = l[1] + l[2] -l[0]
print l[2],
print minp

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == 0 or b == 0:
    pass
elif n >= a + b:
    if a == b:
        min_num = 0
        max_num = a
    else:
        min_num = 0
        max_num = min(a,b)
elif n <= a+ b:
    if a == b:
        min_num = abs(int(n/2)-a)
        max_num = a
    else:
        min_num = abs(a-b)
        max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
import math
l = map(int, raw_input().split())
if l[1] < l[2]:
  l[1], l[2] = l[2], l[1]
if l[1] <= l[0]/2:
  minp = 0
else:
  minp = l[1] + l[2] -l[0]
print l[2],
print minp

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif n == a + b:
    min_num = 0
    max_num = a
elif n > a + b:
    if a == b:
        min_num = 0
        max_num = a
    else:
        min_num = 0
        max_num = min(a,b)
elif n < a+ b:
    if a == b:
        min_num = abs(int(n/2)-a)
        max_num = a
    else:
        min_num = abs(a-b)
        max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
def min(l, r):
    return r if (l < r) else l
def upto0(i):
    return 0 if(i < 0) else i
input = list(map(int, input().split()))
print(max(input[1], input[2]))
print(upto0(input[1] + input[2] - input[0]))

Submission status: Wrong Answer

Solution code:
i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = x
    max = x

min = 0
nx = all - x
ny = all - y

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = nx
min = abs(t - nt)
print("{0} {1}".format(max,min))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif n >= a + b:
    if a == b:
        min_num = 0
        max_num = a
    else:
        min_num = 0
        max_num = min(a,b)
elif n <= a+ b:
    if a == b:
        min_num = abs(int(n/2)-a)
        max_num = a
    else:
        min_num = abs(a-b)
        max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
d = b + c
l = b - c
if b == c:
    print(str(c),str(c))
elif d < a: #12
    if b < c:
        A = b
    else:
        A = c
    B = 0
    print(str(A),str(B))
elif d > a:
    B = b + c - a
    if b < c:
        A = b
    else:
        A = c
    print(str(A),str(B))

Submission status: Wrong Answer

Solution code:
s = list(map(int,input().split()))
a=max(s[1],s[2])
b=max(s[1]+s[2]-s[0],0)
print(a,b)

Submission status: Wrong Answer

Solution code:
i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = all
    max = x

min = 0
nx = all - x
ny = all - y

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = 0
min = abs(t - nt)
print("{0} {1}".format(max,min))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import sys
import math
 
nums = [int(i) for i in input().split(' ')]
 
n = nums[0]
a = nums[1]
b = nums[2]
 

max_n = min(a, b)
 
if a + b >= n:
	min_n = abs(a - b)
else:
	min_n = 0
 
print(max_n, min_n)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math

args = input().split()

n = args[0]
a = args[1]
b = args[2]

if not(n.isdigit()) or int(n) <= 0 or int(n) > 100:
    sys.exit(-1)
if not(a.isdigit()) or int(n) < 0 or int(a) > int(n):
    sys.exit(-1)
if not(b.isdigit()) or int(b) < 0 or int(b) > int(n):
    sys.exit(-1)

n = int(n)
a = int(a)
b = int(b)

reta = a
retb = (n - a) - b
if retb > 0 :
    retb = 0
else:
    retb = abs(retb)

print('{reta} {retb}'.format(reta=reta,retb=retb))

sys.exit(0)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

d = b + c
l = b - c
if b == c:
    B = c
    A = c
    print(str(A),str(B))
elif d < a: #12
    if b < c:
        A = b
    else:
        A = c
    B = 0
    print(str(A),str(B))
     
elif d > a:
    B = b + c - a
    if b < c:
        A = b
    else:
        A = c
    print(str(A),str(B))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys
import math

nums = [int(i) for i in input().split(' ')]

n = nums[0]
a = nums[1]
b = nums[2]

if a < b:
	max_n = a
else:
	max_n = b

if a + b > n:
	min_n = abs(a - b)
else:
	min_n = 0

print(max_n, min_n)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
m = min(A,B)
if 2 * N >= A + B:
  mi = 0
else:
  mi = abs(A-B)
print(str(m) + " " + str(mi))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math

args = input().split()

n = args[0]
a = args[1]
b = args[2]

if not(n.isdigit()) or int(n) <= 0 or int(n) > 100:
    sys.exit(0)
if not(a.isdigit()) or int(n) < 0 or int(a) > int(n):
    sys.exit(0)
if not(b.isdigit()) or int(b) < 0 or int(b) > int(n):
    sys.exit(0)

n = int(n)
a = int(a)
b = int(b)

reta = a
retb = (n - a) - b
if retb > 0 :
    retb = 0
else:
    retb = abs(retb)

print('{reta} {retb}'.format(reta=reta,retb=retb))

Submission status: Wrong Answer

Solution code:

N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=SMALL

if BIG+SMALL<=N:
    MIN=SMALL
    print(str(MAX)+' 0')
    exit(0)

if BIG==SMALL:
    print(str(BIG)+' '+str(SMALL))
    exit(0)

MIN=BIG-SMALL
print(str(MAX)+' '+str(MIN))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif n >= a + b:
    if a == b:
        min_num = 0
        max_num = a
    else:
        min_num = 0
        max_num = min(a,b)
elif n <= a+ b:
    min_num = abs(a-b)
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())
if a > b + c:
    if b >= c:
        print(str(c) +" "+ str(0))
    else:
        print(str(b) +" "+ str(0))
elif a == b and a == c:
    print(str(a)+" "+str(a))
elif a< b+c:
    if b >= c:
        print(str(c) +" "+ str(-a + (b+c)))
    else:
        print(str(b) +" "+ str(-a+(c+b)))
elif a == b or a==c:
    if b >= c:
        print(str(c) +" "+ str(0))
    else:
        print(str(b) +" "+ str(0))
elif a ==b ==c:
    print(str(b)+" "+str(0))

Submission status: Wrong Answer

Solution code:
N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=SMALL

if BIG+SMALL<=N:
    MIN=SMALL
    print(str(MAX)+' 0')
    exit(0)


MIN=BIG-SMALL
print(str(MAX)+' '+str(MIN))

Submission status: Wrong Answer

Solution code:
N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=BIG

if BIG+SMALL<=N:
    MIN=SMALL
    print(str(MAX)+' 0')
    exit(0)


MIN=SMALL
print(str(MAX)+' '+str(MIN))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif a == b:
    min_num = 0
    max_num = a
elif n > a + b:
    min_num = 0
    max_num = min(a,b)
elif n < a+ b:
    min_num = abs(a-b)
    max_num = min(a,b)


print(max_num, min_num)

Submission status: Wrong Answer

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

if n == a and a == b:
    min = n
    max = n
elif n >= a+b:
    min = 0
    if a >= b:
        max = b
    else:
        max = a
    
else:
    min = abs(a - b)
    if a >= b:
        max = b
    else:
        max = a

print(max, " ", min)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())
if a > b + c:
    if b >= c:
        print(str(c) +" "+ str(0))
    else:
        print(str(b) +" "+ str(0))
elif a == b and a == c:
    print(str(a)+" "+str(a))
elif a< b+c:
    if b >= c:
        print(str(c) +" "+ str(-a + (b+c)))
    else:
        print(str(b) +" "+ str(-a+(c+b)))
elif a == b + c:
    print(str(b)+" "+str(0))

Submission status: Wrong Answer

Solution code:
n , x , y = map(int , input().split())

min = x + y - n
if min < 0 : min = 0

if x > y : print (str(x) + " " + str(min))
else : print(str(y) + " " + str(min))

Submission status: Wrong Answer

Solution code:
N,A,B=[int(_) for _ in input().split() ]
if A>=B:
    BIG=A
    SMALL=B
if B>A:
    BIG=B
    SMALL=A

MAX=BIG

if BIG+SMALL>N:
    MIN=SMALL
    print(str(MAX)+' '+str(MIN))
    exit(0)

MIN=0
print(str(MAX)+' '+str(MIN))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math

def main(s):
    n = s[0]
    a = s[1]
    b = s[2]
    
    if not(n.isdigit()) or int(n) <= 0 or int(n) > 100:
        return -1
    if not(a.isdigit()) or int(n) < 0 or int(a) > int(n):
        return -1
    if not(b.isdigit()) or int(b) < 0 or int(b) > int(n):
        return -1

    n = int(n)
    a = int(a)
    b = int(b)

    reta = a
    retb = (n - a) - b
    if retb > 0 :
        retb = 0
    else:
        retb = abs(retb)

    print('{reta} {retb}'.format(reta=reta,retb=retb))
    
    return 0

if __name__ == '__main__':
    args = sys.argv
    if len(args) > 1:
        s = args[1:]
        main(s)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
N = i[0]
a = i[1]
b = i[2]

if N <= 100:
        if(a+b < N):
                if (a < b) :
                        print(a,end=" ")
                elif (a > b):
                        print(b,end=" ")
                else:
                        print(a,end=" ")
                print(0)
        elif(a+b > N):
                if (a < b) :
                        print(a,end=" ")
                        print((a+b) - N)
                elif (a > b):
                        print(b,end=" ")
                        print((a+b) - N)
                else:
                        print(a,end=" ")
                        print(a)

Submission status: Wrong Answer

Solution code:
n , x , y = map(int , input().split())

min = n - x - y

if x > y : print (str(x) + " " + str(min))
else : print(str(y) + " " + str(min))

Submission status: Wrong Answer

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

if n >= a+b:
    min = 0
    if a >= b:
        max = b
    else:
        max = a
    
else:
    min = abs(a - b)
    if a >= b:
        max = b
    else:
        max = a

print(max, " ", min)

Submission status: Wrong Answer

Solution code:
n = input().split()
N = int(n[0])
A = int(n[1])
B = int(n[2])

if A > B:
    a = A
    b = B
elif A < B:
    a = B
    b = A
elif A == B:
    a = A
    b = B

if a != b:
    if a+b < N:
        print(str(b) + ' ' + str(0))
    elif a+b > N:
        print(str(b) + ' ' + str(a - (N-b)))
elif a < N//2:
    print(str(a) + ' ' + str(0))
elif a > N//2:
    print(str(a) + ' ' + str(a-(N-b)))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif n > a + b:
    min_num = 0
    max_num = min(a,b)
elif n < a+ b:
    min_num = abs(a-b)
    max_num = min(a,b)
else:
    pass

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
# 新聞Xを購読しているか？ A
# 「はい」A人

# 新聞Yを購読しているか？ B
# 「はい」B人

# 1 <= N < 100
# 0 <= A <= N
# 0 <= B <= N

# 標準入力
inputstr = input()
inputary = inputstr.split(" ")
print(inputary)
N = int(inputary[0])
A = int(inputary[1])
B = int(inputary[2])

suball = N - A - B
if suball > 0:
    suball = 0
else:
    suball = abs(suball)

if A >= B:
    print(str(B) + " " + str(suball))
elif A < B:
    print(str(A) + " " + str(suball))

Submission status: Wrong Answer

Solution code:
n,a,b = (int(i) for i in input().split())
x=max(a,b)
y=a+b-n
if y < 0:
    y=0
print(x,y)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b and a == n:
    min_num = n
    max_num = n
elif n >= a + b:
    min_num = 0
    max_num = min(a,b)
elif n <= a+ b:
    min_num = abs(a-b)
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
if N==A and A==B and B==N:
    print(N,N)
else:
    if A==B:
        print(A,(A+B)-N)
    else:
        if A>=B:
            if (A+B)>N:
                print(B,A-B)
            else:
                print(B,0)
        else:
            if (A+B)>N:
                print(A,B-A)
            else:
                print(A,0)

Submission status: Wrong Answer

Solution code:

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

if A == B and A == N:
	print(A, A)
else:
	n = 0
	if A + B > N:
		n = A+B-N
	else:
		n = 0


	print(max(A, B), n)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys

def io_generator():
	while True:
		yield raw_input()

#+++++++++++++++++++

def main(io):
	n,a,b= map(int, io.next().split())
	max_num= min(a,b)
	min_num= a+b-n
	ret= str(max_num)+' '+str(min_num)
	return ret


#++++++++++++++++++++

if __name__ == "__main__":
	io=io_generator()
	print main(io)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
min_num = 0
max_num = 0

if a == b:
    min_num = n
    max_num = n
elif n > a + b:
    min_num = 0
    max_num = min(a,b)
elif n < a+ b:
    min_num = abs(a-b)
    max_num = min(a,b)

print(max_num, min_num)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
if A or B == 0:
    print("{} {}".format(0,0))
else:
    a = min(A,B)
    b = A + B - N
    print("{} {}".format(a,b))

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
if a+b-n >= n:
    s = n
elif a+b < 0:
    s = 0
else:
    s = a+b-n
print(min(a,b),s)

Submission status: Wrong Answer

Solution code:
N,A,B=[int(_) for _ in input().split() ]

if A>=B:
    MAX=str(A+B)
    MIN=str(B)
    if A+B>=N:
        print(str(N)+' '+MIN)
        exit(0)
    print(MAX+" "+MIN)
    exit(0)
if B>A:
    MAX=str(A+B)
    MIN=str(B)
    if A+B>=N:
        print(str(N)+' '+MIN)
    print(MAX+" "+MIN)
    exit(0)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
if a+b-n > n:
    s = n
elif a+b < 0:
    s = 0
else:
    s = a+b-n
print(min(a,b),s)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
maximam=0
minimam=0
if a+b-n>=0:
    minimam=a+b-n
else:
    minimam=0
s=[a,b]
maximam=max(s)
print(maximam,minimam)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
if a+b > n:
    s = n
elif a+b < 0:
    s = 0
else:
    s = a+b-n
print(min(a,b),s)

Submission status: Wrong Answer

Solution code:
N, A, B = (int(x) for x in input().split())
c=0
if(A <= B):
    c = A
else:
    c = B
if(A+B > N and A+B == 2*N ):
    print("{} {}".format(c, A+B-N))
else:
    print("{} {}".format(c, 0))

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
if A or B == 0:
    print("0 0")
else:
    a = min(A,B)
    b = A + B - N
    print("{} {}".format(a,b))

Submission status: Wrong Answer

Solution code:
from sys import stdin

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

if B+C <= A:
    print(str(max(B,C)) + ' ' + str(0))
else:
    print(str(max(B,C)) + ' ' +str(B+C-A))

Submission status: Wrong Answer

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

m = 0
x = 0

if a > b:
    x = b
else:
    x = a

if n == a and n == b:
    m = n
elif n < a+b:
    if n == a or n == b:
        m = min(a,b)
    else:
        m = max(a,b) - min(a,b)
elif n > a+b:
    m = max(a,b) - min(a,b)

print(x, m)

Submission status: Wrong Answer

Solution code:

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

n = 0
if N >= A+B:
	n = 0
	if A == B and A == N:
		n = N
elif N < A+B:
	n = (A+B)- N

print(max(A, B), n)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
if N==A and A==B and B==N:
    print(N,N)
else:
    if A>B:
        if (A+B)>N:
            print(B,A-B)
        else:
            print(B,0)
    else:
        if (A+B)>N:
            print(A,B-A)
        else:
            print(A,0)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
m = min(A,B)
if N >= A + B:
  mi = 0
else:
  mi = abs(A-B)
print(str(m) + " " + str(mi))

Submission status: Wrong Answer

Solution code:
N, A, B = map(int,input().split())
if(A == B):
  print(A, A)
else:
  print(min(A, B), min(abs(A - B), 0))

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
if n>=a+b:
    if a>b:
        print(a,0)
    else:
        print(b,0)
else:
    if a>b:
        print(a,a+b-n)
    else:
        print(b,a+b-n)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
if N % 2 == 0:
  mid = N // 2
else:
  mid = N // 2 + 1
large = max(A, B)
small = min(A, B)
if N == A and N == B:
  print(A, B)
elif large > mid:
  print(small, large - mid)
else:
  print(small, 0)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
print('{} {}'.format(min(a, b), a+b-n))

Submission status: Wrong Answer

Solution code:
input_line=[int(x) for x in input().split()]
[i_N,i_A,i_B]=input_line
if i_A>=i_B:
  o_max=i_B
  o_min=i_B-(i_N-i_A)
else:
  o_max=i_A
  o_min=i_A-(i_N-i_B)
print("{} {}".format(o_max,o_min))

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split(' '))

if n > 100 or a > n or b > n:
    raise ValueError

ret_max = min(a, b)

if n > a + b:
    ret_min = 0
else:
    ret_min = max(a, b) - min(a, b)

print(ret_max, ret_min)

Submission status: Wrong Answer

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

m = 0
x = 0

if a > b:
    x = b
else:
    x = a

if n == a and n == b:
    m = n
elif n < a+b:
    if n == a or n == b:
        m = min(a,b)
    else:
        m = max(a,b) - min(a,b)

print(x, m)

Submission status: Wrong Answer

Solution code:
N, A, B = (int(x) for x in input().split())
c=0
if(A <= B):
    c = A
else:
    c = B
if(A+B > N):
    print("{} {}".format(c, A+B-10))
else:
    print("{} {}".format(c, 0))

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n<a+b:
  l=abs(n-abs(b-a))
print("{} {}".format(s,l))

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
print('{} {}'.format(max(a, b), a+b-n))

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n>a+b:
  l=abs(n-abs(b-a))
print("{} {}".format(s,l))

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
print(min(a, b), max((a+b-10), 0))

Submission status: Wrong Answer

Solution code:
from sys import stdin
N,A,B=[int(x) for x in stdin.readline().rstrip().split()]
if N==100 and A==100 and B==100:
    print(100,100)
else:
    if A>B:
        if (A+B)>N:
            print(B,A-B)
        else:
            print(B,0)
    else:
        if (A+B)>N:
            print(A,B-A)
        else:
            print(A,0)

Submission status: Wrong Answer

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

sum = A+B
if A+B <= N:
    min = 0
else:
    min = (A+B)-N

#max
if A >= B:
    max=A
else:
    max = B

print(max,min)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=min(a,b)
l=0
if n>a+b:
  l=abs(b-a)
print("{} {}".format(s,l))

Submission status: Wrong Answer

Solution code:
def read():
    N, A, B = map(int, input().strip().split())
    return N, A, B


def solve(N, A, B):
    intersect_max = min(A, B)
    intersect_min = max(0, A + B - N)
    return intersect_max, intersect_min


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))

Submission status: Wrong Answer

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

if a < b:
    print(a, 0)
elif a > b:
    print(b, a- b)
else:
    print(a, b)

Submission status: Wrong Answer

Solution code:
def main():
    N, A, B = map(int, input().split())
    if N == A and N == B:
        # 全員が両方読んでいる場合
        print(N, N)
        return

    max_result = max([A, B])
    min_result = min([A, B])
    if A + B > N:
        # AとBの合計がNより大きい場合、最大は小さい方の数、最小は大ー小
        print(min_result, max_result - min_result)
    elif A + B <= N:
        # AとBの合計がNより小さい場合、最大は小さい方の数、最小は0
        print(min_result, 0)



main()

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
if a[1] >= a[2]:
  b = a[2]
if a[2] >= a[1]:
  b = a[1]

c = a[0] - a[1] - a[2]
if c <= 0:
  c = 0
d = str(b) + " " + str(c)
print(d)

Submission status: Wrong Answer

Solution code:
n_k = list(map(int, input().split()))
n,a,b = n_k[0],n_k[1],n_k[2]
max,min = 0,0
if n > a+b:
    min=0
    if a<b:
        max=a
    else:
        max=b
else:
    if a < b:
        min=b-a
        max=a
    else:
        min=a-b
        max=b
print(str(max)+' '+str(min))

Submission status: Wrong Answer

Solution code:
N, A, B = map(int,input().split())
if(N == A == B):
  print(N, N)
else:
  if(A > B):
    print(min(A, B), max(B - A, 0))
  else:
    print(min(A, B), max(A - B, 0))

Submission status: Wrong Answer

Solution code:

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

n = 0
if N >= A+B:
	n = 0
elif N < A+B:
	n = (A+B)- N

print(max(A, B), n)

Submission status: Wrong Answer

Solution code:
def main():
    N, A, B = map(int, input().split())
    if N == A and N == B:
        # 全員が両方読んでいる場合
        print(N, N)
        return

    max_result = max([A, B])
    min_result = min([A, B])
    if A + B > N:
        # AとBの合計がNより大きい場合、最大は小さい方の数、最小は大ー小
        print(min_result, max_result - min_result)
    elif A + B < N:
        # AとBの合計がNより小さい場合、最大は小さい方の数、最小は0
        print(min_result, 0)



main()

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
a = min(A,B)
b = A + B - N
print("{} {}".format(a,b))

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
_max = max(b,c)
_min = max(0, ((b+c)-a))
print('{0} {1}'.format(_max, _min))

Submission status: Wrong Answer

Solution code:
N, A, B = map(int,input().split())
if(N == A == B):
  print(N, N)
elif(A == B):
  print(A, A)
else:
  print(min(A, B), max(A - B, 0))

Submission status: Wrong Answer

Solution code:
li = [int(i) for i in input().split()]
n = li[0]
a = li[1]
b = li[2]
res1 = max(a,b)
if a+b-n<0:
    res2 =0
else:
    res2=a+b-n
print(res1, res2)

Submission status: Wrong Answer

Solution code:
num = list(map(int,input().split()))
if num[1] > num[2]:
  a = num[2]
else:
  a = num[1]
b = num[1] + num[2] - num[0]
print(str(a) + " " + str(b))

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
s=min(a,b)
l=abs(a+b)-n
print(str(s)+" "+str(l))

Submission status: Wrong Answer

Solution code:
n,a,b = list(map(int, input().split()))
if n > a+b:
    ans = 0
else:
    ans = a+b-n
print(max(a,b), ans)

Submission status: Wrong Answer

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

max = A+B
if A>=B:
    min = B
else:
    min = A

if max>10:
    if max>N:
        print(min,N)
    else:
        print(min,max-10)
else:
    print(min,0)