Minimum numbers ( smaller than or equal to N ) with sum S | Java program to find the minimum numbers required to get to S ; Function to find the minimum numbers required to get to S ; Driver Code
import java . io . * ; class GFG { static int minimumNumbers ( int n , int s ) { if ( ( s % n ) > 0 ) return s / n + 1 ; else return s / n ; } public static void main ( String [ ] args ) { int n = 5 ; int s = 11 ; System . out . println ( minimumNumbers ( n , s ) ) ; } }