Three points

Let d(p, q) denote the geometric distance between two points p and q on
the plane. Given three points a, b and c, please choose three points
a^(′), b^(′) and c^(′) such that:

- a^(′), b^(′) and c^(′) are on the same straight line;

- the sum of distances d(a, a^(′)) + d(b, b^(′)) + d(c, c^(′)) is as
  small as possible.

Input

Input consists of several cases, each one with three different points a,
b and c. Every given point has two real coordinates with at most two
digits after the decimal point, and with absolute value between 0 and
10⁶.

Output

For every case, print the minimum sum of distances with four digits
after the decimal point. The input cases have no precision issues.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T09:55:46.690Z

© Jutge.org, 2006–2026.
https://jutge.org
