#CCBCHBA0000060. Chọn một giá trị đạt cực tiểu (Minimum and Its Frequency)
Chọn một giá trị đạt cực tiểu (Minimum and Its Frequency)
Minimum and Its Frequency
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Read n integers. Print the minimum value and its number of occurrences. Reset the count to one when a smaller value appears; increment it on equality.
Input
The first line contains n (1<=n<=100000); the next line contains n integers in [-10^9,10^9].
Output
Print the minimum and its occurrence count, separated by a space.
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): .
- Subtask 3 (50%): .
Examples
Example 1
Input:
5
4 1 1 5 1
Output:
1 3
Explanation:
The minimum 1 appears three times.
Example 2
Input:
3
-1 -4 -1
Output:
-4 1
Explanation:
A new smaller minimum resets the count.