407150: GYM102697 121 Space Invaders
Description
You're traveling through space in your spaceship, when your ship's radar detects several hostile aliens near the ship. You need to figure out how close each alien is to your ship.
In three dimensions, the distance between two points, each with an X, Y, and Z coordinate, is defined as follows:
Given the coordinates of your ship, in 3D space, figure out how far away each alien is from your ship, using the formula described above.
InputThe first line of input contains three space-separated integers $$$X$$$, $$$Y$$$, and $$$Z$$$: the coordinates of your ship in 3D space. The next line of input contains a positive integer $$$n$$$ indicating the number of aliens that have been detected by the ship's radar. The next $$$n$$$ lines each contain three space-separated integers, each representing the coordinates of an alien.
OutputOutput $$$n$$$ lines. On each line, output a single decimal number: the distance between your ship and each alien, in the order given in the input. You don't need to round your answers.
ExamplesInput7 3 8 6 2 1 5 3 7 6 4 2 1 9 8 4 7 3 8 5 11 16Output
6.164414002968976 6.0 7.681145747868608 6.708203932499369 0.0 11.489125293076057Input
2 4 6 3 -2 -4 -6 2 -4 -6 -2 4 6Output
14.966629547095765 14.422205101855956 4.0