You love drinking orange juice. But all you have is an infinite supply of the juice coming out of a pipe, and a container in the form of a rectangle of width W and length N. The rectangle is divided into N columns of length = 1 and has some barriers (columns of some height Ai) at certain places of width same as the width of rectangle and length = 1. Since you cannot drink the juice directly from the pipe, you first pour it into the container. You have to find out the volume of juice that the container can hold.
For eg. given a container of width = 5 and the container columns are described as [3, 0, 0, 2, 0, 4] meaning that there is a barrier of height 3 at pos1, height 0 at pos2 and pos3, height 2 at pos4, height 0 at pos5 and height 4 at pos6 each of length 1. So the container can hold = (3 + 3 + 1 + 3) * (1) * (5) = 50 volume of juice.
INPUT
OUTPUT
CONSTRAINTS
Subtask1 (20 points)
Subtask2 (80 points)