Question: solve this question You are given an array in which the number of elements is even. You are allowed to perform N/2 operations on it.

solve this question

solve this question You are given an array in which the numberof elements is even. You are allowed to perform N/2 operations on

You are given an array in which the number of elements is even. You are allowed to perform N/2 operations on it. In each operation, you take two elements and delete them from the array, and for that, you'll get some points. If it is the ith operation (1 based indexing), then you'll get (i * god of those two numbers) points. Your task is to find the maximum sum of points you can get after deleting the whole array Input Format The first line contains an integer, N, denoting the number of elements in arr. Each line i of the N subsequent lines (where 0 (10, 16 10 (35, 14) and you'll get points 1* 3 - 2-5 3 *7 = 34. 5 You can delete in order (1. 3) > (2, 4) and you get points 1 " 1 - 2 . 2 co NO

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 Programming Questions!