text: Print N lines of 4 numbers such that every pair among 4 numbers has a GCD K | Function to prvar N lines ; Iterate N times to prvar N lines ; Driver Code
code: function printLines ( n , k ) { for ( i = 0 ; i < n ; i ++ ) { document . write ( k * ( 6 * i + 1 ) + " " + k * ( 6 * i + 2 ) + " " + k * ( 6 * i + 3 ) + " " + k * ( 6 * i + 5 ) + " " ) ; } } var n = 2 , k = 2 ; printLines ( n , k ) ;