atcoder#NIKKEI2019QUALA. Subscribers
Subscribers
Score : points
Problem Statement
We conducted a survey on newspaper subscriptions. More specifically, we asked each of the respondents the following two questions:
- Question : Are you subscribing to Newspaper X?
- Question : Are you subscribing to Newspaper Y?
As the result, respondents answered "yes" to Question , and respondents answered "yes" to Question .
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
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
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.
10 3 5
3 0
In this sample, out of the respondents, answered they are subscribing to Newspaper X, and answered they are subscribing to Newspaper Y.
Here, the number of respondents subscribing to both newspapers is at most and at least .
10 7 5
5 2
In this sample, out of the respondents, answered they are subscribing to Newspaper X, and answered they are subscribing to Newspaper Y.
Here, the number of respondents subscribing to both newspapers is at most and at least .
100 100 100
100 100