Minimum and maximum number of N chocolates after distribution among K students | CPP implementation of the above approach ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int main ( ) { int n = 7 , k = 3 ; if ( n % k == 0 ) cout << n / k << " ▁ " << n / k ; else cout << ( ( n - ( n % k ) ) / k ) << " ▁ " << ( ( ( n - ( n % k ) ) / k ) + 1 ) ; return 0 ; }