Find maximum subset-sum divisible by D by taking at most K elements from given array
Given an array A[] of size N, and two numbers K and D, the task is to calculate the maximum subset-sum divisible by D possible by taking at most K elements from A. Examples: Input: A={11, 5, 5, 1, 18}, N=5, K=3, D=7Output:28Explanation:The subset {5, 5, 18} gives the maximum sum=(5+5+18)=28 that is