You are given an array Array of size N. You have to find the maximum value of K such that after choosing K numbers from the array the DiffValue of chosen numbers is less than or equal to S. DiffValue for a set of integers is defined as the largest possible difference among any two integers of the set. However if you choose K numbers from the array, value of all the chosen numbers get multiplied by K. Hence print two integers i.e the largest value of number K and largest possible DiffValue corresponding to value of K.
Aucun commentaire:
Enregistrer un commentaire