I have an array of n integers A1,A2,...,An, I'm supposed to find the values of n other integers B1,B2,....,Bn for which there's a rule B1+B2+...+Bn = K and such that the maximum value of A1*B1,A2*B2,....,An*Bn is as low as possible. How can I do this if 1<=n<=30 and 1 <= K <= 200000000000 ?
which algorithm can I use to find the optimal ( minimum ) maximum value for numbers ai*bi 1<=i<=n for given array with n 'a's , and arbitarily chosen n 'b's such that the sum of the 'b's equals a given integer k?
Aucun commentaire:
Enregistrer un commentaire