Under construction

Still being built. Things may change

Axis-Aligned Area

Interview

Time limit2sMemory limit1024 MB

Summary
Given four sorted stick lengths, find the largest area of an axis-aligned rectangle the sticks can enclose.
Level

Easy3 of 10

Topics
Math, Implementation
Solved
No attempts yet

Statement

Alex has four sticks with positive integer lengths a1a_1, a2a_2, a3a_3, and a4a_4 (a1≤a2≤a3≤a4a_1 \le a_2 \le a_3 \le a_4). She places each stick parallel to one of the two coordinate axes. Find the largest area that the sticks can enclose.

Input

Four positive integers a1a_1, a2a_2, a3a_3, and a4a_4 are given, each on a separate line, in non-decreasing order (1≤a1≤a2≤a3≤a4≤1001 \le a_1 \le a_2 \le a_3 \le a_4 \le 100).

Output

Print the maximum area that can be enclosed.

Hint

The figure below shows one optimal placement for the first sample. The enclosed area is shaded in gray.

Examples2

  1. Example 1

    Input
    2
    2
    4
    7
    
    Expected output
    8
    
  2. Example 2

    Input
    10
    10
    10
    10
    
    Expected output
    100