All possible values of floor ( N / K ) for all values of K | C ++ Program for the above approach ; Function to print all possible values of floor ( N / K ) ; loop from 1 to N + 1 ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void allQuotients ( int N ) { set < int > s ; for ( int k = 1 ; k <= N + 1 ; k ++ ) { s . insert ( N / k ) ; } for ( auto it : s ) cout << it << " ▁ " ; } int main ( ) { int N = 5 ; allQuotients ( N ) ; return 0 ; }