Rectangle Area & Perimeter

MEDIUM · C · 2000ms

For the garden plot next to the building, Priya needs to quickly compute both the area and the perimeter of a rectangular flowerbed. Given an axis-aligned rectangle by its bottom-left (x1,y1) and top-right (x2,y2) corners, print its area and perimeter, space-separated.

Input

Four integers x1 y1 x2 y2 (x1<x2, y1<y2).

Output

Area and perimeter, space-separated.

Constraints

0 ≤ coords ≤ 10^4

Sample Input

0 0 4 3

Sample Output

12 14
main.c
Loading editor…

Write C, then Run (custom I/O) or Submit (sample tests). ⌘/Ctrl+Enter submits.

Rectangle Area & Perimeter · DIU ContestHub