Https://hack.codingblocks.com/contests/c/474/1410

https://hack.codingblocks.com/contests/c/474/1410
sir plz tell me about x how it related to sum after rotation…with some example

Hello Rahul, you need to think it’s logic yourself first.
If you want hints then you can go through this -->> actually operations are performed for a query , answer till that query becomes integral multiple of intitial array sum. And in this way time complexity becomes O(q).