#CCBCHBAHAI0000093. Tháng mưa nhiều nhất và ít nhất

    ID: 1011 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesWorking with numbers

Tháng mưa nhiều nhất và ít nhất

Wettest and Driest Months

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given nonnegative integer rainfall values r1,…,r12r_1,\ldots,r_{12}, compute

T=∑m=112rm,A=T/12.T=\sum_{m=1}^{12}r_m,\qquad A=T/12.

Let Rmax⁡R_{\max} and Rmin⁡R_{\min} be the maximum and minimum values. On ties, choose the smallest month number. Print total, average to 2 decimals, and the earliest wettest/driest month with its rainfall.

Input

One line contains exactly 12 integer rainfall values.

Output

Line 1: TT. Line 2: AA with 2 decimals. Line 3: mmax⁡m_{\max} and Rmax⁡R_{\max}. Line 4: mmin⁡m_{\min} and Rmin⁡R_{\min}.

Subtask

Subtask 1 (20 points): Dãy lượng mưa tăng nghiêm ngặt: r1<r2<⋯<r12r_1<r_2<\cdots<r_{12}, 0≤rm≤1060\le r_m\le10^6.

Subtask 2 (30 points): Giá trị cực đại và cực tiểu đều xuất hiện đúng một lần, 0≤rm≤1060\le r_m\le10^6.

Subtask 3 (50 points): 0≤rm≤1060\le r_m\le10^6, cho phép mọi trường hợp hòa.

Example

Input

10 20 35 40 55 80 120 110 75 50 25 10

Output

630
52.50
7 120
1 10

Explanation

The result follows directly from the mathematical definition above.