P27321 [AtCoder] Correct answers to multiple-choice questions are all the same option...
提高
题目描述

Problem Description

In the final exam of Classical Chinese for the first-year students of Chikushi High School, Class of 72, there was a note on the cover that said, "The correct answers to the multiple-choice questions are all the same option. If you notice this, keep it secret and do not speak about it until the end of the exam."

Suppose this exam consisted only of $ N $ multiple-choice questions, where each question required choosing one option from $ 1 $ to $ M $.

Penguin-kun, who did not notice this note, wrote down the answer $ A_i $ for each question $i\ (1\ \leq\ i\ \leq\ N)$.

What are the minimum and maximum possible values for Penguin-kun's number of correct answers?

Input Format

The input is given from the standard input in the following format:

$ N $ $ M $ $ A_1 $ $ A_2 $ $\ldots$ $ A_N $

Output Format

Output the minimum and maximum possible values for Penguin-kun's number of correct answers, in this order, separated by a space.

Sample Input and Output

Sample Input #1

3 2
1 1 2

Sample Output #1

1 2

Sample Input #2

4 5
5 1 1 5

Sample Output #2

0 2

Notes/Hints

Constraints

  • $1\ \leq\ N\ \leq\ 2\ \times\ 10^5$
  • $1\ \leq\ M\ \leq\ 10^9$
  • $1\ \leq\ A_i\ \leq\ M$
  • All inputs are integers

Sample Explanation 1

If the correct answer to all questions in the exam was $ 1 $, Penguin-kun's number of correct answers would be $ 2 $. If the correct answer to all questions in the exam was $ 2 $, Penguin-kun's number of correct answers would be $ 1 $. Therefore, the minimum and maximum possible values for Penguin-kun's number of correct answers are $ 1 $ and $ 2 $, respectively.

Sample Explanation 2

If the correct answer to all questions in the exam was $ 2 $, Penguin-kun's number of correct answers would be $ 0 $, which is the minimum possible value. If the correct answer to all questions in the exam was $ 1 $, Penguin-kun's number of correct answers would be $ 2 $, which is the maximum possible value. Original idea: penguinman

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 2 1 1 2
样例输出
1 2