Your solution is very similar to this: split initial array into $O\left(\sqrt{k}\right)$ blocks and calculate "MO segment" between each pair of blocks. Then for each query use appropriate "MO segment" to answer it in guaranteed $O\left(\dfrac{n}{\sqrt{k}}\right)$ and then return this "MO segment" back to initial state. Even though it works in guaranteed time, it is probably slower in practice then your amortized solution.
Your solution is very similar to this: split initial array into $O\left(\sqrt{k}\right)$ blocks and calculate "MO segment" between each pair of blocks. Then for each query use appropriate "MO segment" to answer it in guaranteed $O\left(\dfrac{n}{\sqrt{k}}\right)$ and then return this "MO segment" back to initial state. Even though it works in guaranteed time, it is probably slower in practice then your amortized solution.