#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%): n≤5,∣ai∣≤10n\le5,|a_i|\le10.
  • Subtask 2 (30%): n≤500,∣ai∣≤104n\le500,|a_i|\le10^4.
  • Subtask 3 (50%): n≤100000,∣ai∣≤109n\le100000,|a_i|\le10^9.

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.