Driver code
public static void Main ( String [ ] args ) { int N = 8 , queries = 6 ; int [ , ] Q = { { 1 , 4 } , { 3 , 4 } , { 4 , 5 } , { 5 , 5 } , { 7 , 8 } , { 8 , 8 } } ; int [ ] A = new int [ N ] ; Console . Write ( subarrayLength ( A , Q , N , queries ) ) ; } }