I recently go through this problem and try to solve it: https://codeforces.me/gym/102697/problem/008 This is my code: https://onlinegdb.com/mz1QjL3om I tried the formula in the problem but it didn't work with the test cases. I think that some test cases are wrong. Help me!!








It's about how you parse test cases.
For example, in the second case, your code interprets the points as $$$\left(7, 4, 3\right)$$$ and $$$\left(17, 6, 2\right)$$$ but the actual coordinates are $$$\left(7, 3, 6\right)$$$ and $$$\left(4, 17, 2\right)$$$.
The statement says "Each test case N will consist of two lines: the value of the first point, and the value of the second point, in the Nth dimension." which means 1st component of A is given, then 1st component of B, then 2nd component of A, then second component of B etc.