Problem: rectangle area in a coordinate plane

A Rectangle is given with the coordinates of both of its opposite angles (x1, y1) – (x2, y2). Calculate its area and perimeter. The input is read from the console. The numbers x1, y1, x2 and y2 are given one per line. The output is printed on the console and it has to contain two lines, each with one number - the area and the perimeter.

Sample Input and Output

Input Output
60
20
10
50
1500
160
30
40
70
-10
2000
180
600.25
500.75
100.50
-200.5
350449.6875
2402

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/504#6.

results matching ""

    No results matching ""