Nothing Is Absolute, Everything Is Relative!

You are given an integer array, A[]A[ ]A[] of size NNN, and an integer MMM. Then you have to perform a total of MMM operations on the array. The operations can be of 222 types. They are:


This is a companion discussion topic for the original entry at https://toph.co/p/nothing-is-absolute-everything-is-relative