Driver Code
public static void Main ( ) { int [ ] arr = { 2 , 6 , 9 } ; int n = arr . Length ; int [ ] prefix = new int [ n ] ; int [ ] suffix = new int [ n ] ; FillPrefixSuffix ( prefix , arr , suffix , n ) ; int l = 0 , r = 0 ; Console . WriteLine ( GCDoutsideRange ( l , r , prefix , suffix , n ) ) ; l = 1 ; r = 1 ; Console . WriteLine ( GCDoutsideRange ( l , r , prefix , suffix , n ) ) ; l = 1 ; r = 2 ; Console . Write ( GCDoutsideRange ( l , r , prefix , suffix , n ) ) ; } }