Company: Goldman Sachs_10july
Difficulty: medium
Question 12 Problem Description A list of N integers is given. Your task is to calculate the "zeta sum" of the process until the list becomes empty: Step 1 [First element]: Multiply the first element by 1 (its position). Add the largest element currently in the list to this product to get the zeta sum of this element. Delete the first element from the list. Step 2 [Last element]: Multiply the last element by its current position in the list (position counting always starts from 1). Add the largest element currently in the list to this product to get the zeta sum of this element. Delete the last element from the list. Repeat these two steps alternately on the remaining list until no elements remain. The zeta sum of the list is the total of the zeta sums of all the elements in the list. Write a program that accepts N integers and prints the total "zeta sum" of the list. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as th