#C1936. Earliest Book Return Day

    ID: 45196 Type: Default 1000ms 256MiB

Earliest Book Return Day

Earliest Book Return Day

You are given an integer nn representing the number of books and a list of nn integers where each integer indicates the number of days that a book can be borrowed. Your task is to determine the earliest return day and count how many books are due on that day. Formally, let d=min1inborrow_days[i]d = \min_{1 \leq i \leq n} borrow\_days[i] and let countcount be the number of times dd appears in the list. You should output dd and countcount.

inputFormat

The input consists of two lines. The first line contains an integer nn (1n1051 \le n \le 10^5) representing the number of books. The second line contains nn space-separated integers, where the ii-th integer represents the number of days for which the ii-th book can be borrowed.

outputFormat

Output a single line with two integers separated by a space: the earliest return day (i.e. the minimum number from the list) and the number of books that are due on that day.## sample

3
10 5 8
5 1

</p>