Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions