Store all the queries
int [ , ] query = new int [ , ] { { 2 , 1 , 3 } , { 1 , 3 , 0 } , { 2 , 0 , 3 } , { 1 , 4 , 0 } , { 2 , 3 , 5 } } ; int n = arr . Length ; rotatedSumQuery ( arr , n , query , Q ) ; } }