Question: write program in java Problem Description Mr Hola has an array A of size N and an integer B gifted to him by Mrs Hola.

 write program in java Problem Description Mr Hola has an array

A of size N and an integer B gifted to him by

write program in java

Problem Description Mr Hola has an array A of size N and an integer B gifted to him by Mrs Hola. The Aesthetic Value of the array is defined as the summation of A[i]A[i+B] for all i from 1 to NB. You need to find the minimum Aesthetic value possible for any permutation of the array A. Problem Constraints 2N31051Bmin(5000,N1)109A[i]109 Input Format The first argument given is an array, A. The second argument given is an integer, B. Return an integer denoting the minimum possible Aesthetic value of any permutation of array A. Example Input Input 1: A=[4,3,4,3,2,5]B=3. Input 2: A=[3,5,3,5,3]B=2 Example Output Output 1: 3 Output 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!