There is a corporation with N employees with ids 1,2,…,N. Each employee has some initial monthly salary. There are two types of events:
After each event, each employee's happiness increases by 1 if their salary has just increased and decreases by 1 if their salary has just decreased — nothing happens if their salary didn’t change.
There are also two types of queries:
Process Q events and queries.
The first line contains two integers N and Q. The next line contains N integers representing the initial salaries of the employees. The next Q lines describe consecutive events and queries, formatted as follows:
0 l r c
1 l r c
2 l r
3 l r
For each query of type 2 and type 3, output the result on a new line. The result should be printed as a fraction of the form P/Q where P and Q are coprime integers (gcd(P,Q)=1).
Input | Output |
---|---|
5 8 1 3 5 4 2 1 2 5 -1 2 1 4 0 2 3 3 3 1 5 1 4 5 3 0 3 4 5 3 1 5 2 2 5 | 5/2 -4/5 -2/5 17/4 |