LCC '21 Contest 4 S1 - A New Season of Art

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 128M

Problem type

After nearly two years of captivity inside of [REDACTED]'s torture chamber, hewmatt10 has finally been set free! Promising to be a better person without rebellious thoughts, he promptly returns to the remains of his bunker from years past and discovers a piece of treasure. One that he wouldn't let succumb to the horrors of what happened last time.

This valuable relic was none other than his trusty paintbrush and palette, which while hewmatt10 recognized was covered in ash and dust, was remarked by hewmatt10 as a brand-new piece of technology.

hewmatt10 wants to create a painting with his new favourite shape: the rectangle! Consisting of two rectangles parallel to the axes on a canvas, centered at (x_1, y_1) and (x_2, y_2) and with a length and height of l_1, h_1, l_2, h_2 respectively, he wants to know how much paint he will need for his creation. Length is defined as the horizontal x distance a rectangle spans, and height is defined as the vertical y distance it spans.

Can you help hewmatt10 find the total area of the two rectangles?

Input Specification

The first line of input contains four space-separated integers, x_1, y_1, l_1 and h_1.

The second line of input contains four space-separated integers, x_2, y_2, l_2 and h_2.

Output Specification

Output the total area of the two rectangles. Output will be accepted if it is accurate relative to 9 digits.

Constraints

All input variables will be positive integers i such that 0 \le i \le 10^9.

Sample Input

0 0 100 100
50 50 100 100

Sample Output

17500.0

Comments

There are no comments at the moment.