All possible values of floor ( N / K ) for all values of K | Function to print all possible values of floor ( N / K ) ; loop from 1 to N + 1 ; Driver code
function allQuotients ( N ) { var s = new Set ( ) ; for ( var k = 1 ; k <= N + 1 ; k ++ ) { s . add ( parseInt ( N / k ) ) ; } var ls = Array . from ( s ) . reverse ( ) ; ls . forEach ( v => document . write ( v + " " ) ) } var N = 5 ; allQuotients ( N ) ;