Driver code
public static void Main ( string [ ] argv ) { int [ ] a = { 1 , 1 , 2 , 1 , 3 , 4 , 5 , 2 , 8 } ; int n = a . Length ; ArrayList q = new ArrayList ( ) ; q . Add ( new Query ( 0 , 4 ) ) ; q . Add ( new Query ( 1 , 3 ) ) ; q . Add ( new Query ( 2 , 4 ) ) ; int m = q . Count ; printQuerySums ( a , n , q , m ) ; } }