Given coordinates of two points in 1-dimensional number line, 2-dimensional coordinate plane, and 3-dimensional space, find the distance between them.
Definition:
The Euclidean distance between two points is calculated by the following formulas:
The input consists of three lines.
First line: Coordinates of two points on a 1D number line. Two integers separated by a space. The first number is the coordinate of the first point, the second number is the coordinate of the second point.
Second line: Coordinates of two points on a 2D plane. Four integers separated by spaces. The first two numbers are the (x, y) coordinates of the first point, the next two numbers are the (x, y) coordinates of the second point.
Third line: Coordinates of two points in 3D space. Six integers separated by spaces. The first three numbers are the (x, y, z) coordinates of the first point, the next three numbers are the (x, y, z) coordinates of the second point.
Print three lines.
First line: The distance between the two 1D points, rounded to 3 decimal places.
Second line: The distance between the two 2D points, rounded to 3 decimal places.
Third line: The distance between the two 3D points, rounded to 3 decimal places.
This editor records if code is AI assisted. Write it yourself — if you are stuck, ask your teacher.