electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

Area of a right triangle

Time Limit: 1000msMemory Limit: 256MB
View Submissions

Problem Description

Given the coordinates of three points AAA, BBB, CCC. Find the area of the right triangle formed by these points.

Input Format

The input contains six values: XAX_AXA​, YAY_AYA​, XBX_BXB​, YBY_BYB​, XCX_CXC​, YCY_CYC​. All values do not exceed 10910^9109 in absolute value. It is guaranteed that the segments ABABAB and ACACAC are the legs of the triangle.

Output Format

Output the area value rounded to six decimal places.

Examples

Example 1
Input
0 0
3 0
0 4
Output
6
Example 2
Input
-2 0
1 4
2 -3
Output
12.5

© 2026 Electicode. All rights reserved.