Driver code
let n = 3 ; let m = 3 ; let query = new Array ( m ) ; for ( let i = 0 ; i < m ; i ++ ) { query [ i ] = new Array ( 2 ) ; for ( let j = 0 ; j < 2 ; j ++ ) { query [ i ] [ j ] = 0 ; } } let arr = [ 36 , 24 , 72 ] ; query [ 0 ] [ 0 ] = 1 ; query [ 0 ] [ 1 ] = 3 ; query [ 1 ] [ 0 ] = 3 ; query [ 1 ] [ 1 ] = 12 ; query [ 2 ] [ 0 ] = 2 ; query [ 2 ] [ 1 ] = 4 ; print_gcd_online ( n , m , query , arr ) ;