#P12013. [Ynoi April Fool's Round 2025] 牢夸
[Ynoi April Fool's Round 2025] 牢夸
Background


Problem Description
Ai Hoshino Aiku Aimi gives you a sequence of length , with a total of operations. There are two types of operations:
- Given , add to .
- Given , query $\mathop{\max}\limits_{l\le L<R\le r}\frac{\sum\limits_{i=L}^R a_i}{R-L+1}$.
Input Format
The first line contains two integers .
The second line contains integers .
The next lines each contain either 1,l,r,x or 2,l,r, describing one operation.
Output Format
For each operation of type 2, output one line containing the answer as an irreducible fraction (in the form a/b or -a/b or 0/1; are coprime positive integers). For example, should be output as 5/3, -2/3, -1/1, 0/1, 2/1, respectively.
5 8
-7 -8 -1 5 8
1 4 5 -3
1 2 3 7
1 5 5 3
1 1 4 1
2 4 5
1 3 4 -1
1 1 2 7
2 4 5
11/2
5/1
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, .
For of the testdata, .
For the other of the testdata, there is no operation 1.
For of the testdata, , , and all values are integers. For operation 2, it is guaranteed that there is no case with .
Translated by ChatGPT 5