Generate an N | C ++ program for the above approach ; Function to minimize the maximum element present in an N - length array having sum of elements divisible by K ; Return the ceil value of ( K / N ) ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minimumValue ( int N , int K ) { return ceil ( ( double ) K / ( double ) N ) ; } int main ( ) { int N = 4 , K = 50 ; cout << minimumValue ( N , K ) ; return 0 ; }