Minimum numbers ( smaller than or equal to N ) with sum S | C ++ program to find the minimum numbers required to get to S ; Function to find the minimum numbers required to get to S ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minimumNumbers ( int n , int s ) { if ( s % n ) return s / n + 1 ; else return s / n ; } int main ( ) { int n = 5 ; int s = 11 ; cout << minimumNumbers ( n , s ) ; return 0 ; }