#C1453. Maximum Customer Visits

    ID: 44189 Type: Default 1000ms 256MiB

Maximum Customer Visits

Maximum Customer Visits

You are given a list of integers representing the number of visits made by different customers. Your task is to determine the maximum number of visits any customer made, and count how many customers achieved that maximum number of visits.

More formally, given a list \(v_1, v_2, \ldots, v_N\), find the values:

[ \text{max} = \max_{1 \le i \le N} v_i, \quad \text{count} = #{i \mid v_i = \text{max}} ]

If the list is empty (i.e. \(N=0\)), then both values should be 0.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains an integer \(N\) representing the number of customers.
  • The second line contains \(N\) space-separated integers where the \(i\)-th integer represents the number of visits made by the \(i\)-th customer. If \(N = 0\), the second line may be empty.

outputFormat

Print two integers separated by a space on a single line:

  • The first integer is the maximum number of visits.
  • The second integer is the number of customers who made that many visits.
  • If the input list is empty, output "0 0".
## sample
5
3 2 3 5 5
5 2