Intense heat
Time: 1 s · Memory: 256 MB
- Prefix sums
Statement
The temperature over days is known: on day it is degrees. The average temperature of a block of consecutive days of length at least is the sum of its temperatures divided by the number of days. Find the maximum average temperature over all such blocks.
Input format
The first line contains and (). The second line contains integers ().
Output format
Print the answer as an irreducible fraction p/q, where and are coprime positive integers. The denominator is printed even for an integer answer, for example 5/1.
Examples
Input
4 3 3 4 1 2
Output
8/3
Note
With prefix sums the sum of any block takes , so checking all blocks is — operations for . Compare fractions without floating point: . Finally divide and by their GCD.
In the example the best block is with average .
Source: Codeforces, problem 1003C.
