#K57652. Taco: Peak Popularity Analysis
Taco: Peak Popularity Analysis
Taco: Peak Popularity Analysis
In this problem, you are given the number of customers visiting a taco stand over n consecutive days. Your task is to determine three things:
- The peak day (i.e. the day with the maximum number of customers, 1-indexed). In the case of a tie, choose the earliest day.
- The maximum number of customers on that peak day.
- The total number of customers over all n days.
The daily counts are given as \(P_1, P_2, \ldots, P_n\). For instance, if the input is 5
followed by 10 30 20 50 40
, then the peak day is 4
(since 50 is the maximum), and the total number of customers is 150
.
inputFormat
The input is read from stdin and consists of two lines:
- The first line contains a single integer n representing the number of days.
- The second line contains n space-separated integers \(P_1, P_2, \ldots, P_n\) where \(P_i\) denotes the number of customers on the \(i\)-th day.
outputFormat
Output to stdout exactly three integers separated by a space: the peak day (1-indexed), the maximum number of customers on that day, and the total number of customers over all days.
## sample5
10 30 20 50 40
4 50 150