{"raw_statement":[{"iden":"statement","content":"Calculate the distance between two points of a specified dimension. The common distance formula still applies to higher dimensional points with a small modification. You will input two points and display the distance between them as you normally would with the distance formula.\n\nThe n-dimensional distance formula can be expressed as\n\n$d (p, q) = sqrt((q_1 -p_1)^2 + (q_2 -p_2)^2 +... + (q_n -p_n)^2)$\n\nor in other terms:\n\n$sqrt(sum_(i = 1)^n (q_i -p_i)^2) = d$\n\nRemember that _math.sqrt_ will calculate the square root of a number (you also have to add the line _import math_ at the top of the program).\n\nThe first line contains the dimension D between 2 and 500. Then, D test cases will follow.\n\nEach 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.\n\nEach of these values is an integer between -5000 and 5000, inclusive.\n\nA decimal number N representing the distance between the two points. Do not round your answer.\n\n"},{"iden":"input","content":"The first line contains the dimension D between 2 and 500. Then, D test cases will follow.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.Each of these values is an integer between -5000 and 5000, inclusive."},{"iden":"output","content":"A decimal number N representing the distance between the two points. Do not round your answer."},{"iden":"examples","content":"Input2\n1\n1\n1\n2\nOutput1.0\nInput3\n7\n4\n3\n17\n6\n2\nOutput14.866068747318506\nInput4\n-2367\n-2873\n-4279\n-2321\n-1302\n-1341\n-2893\n651\nOutput4080.5951771769764\n"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ D \\in \\mathbb{Z} $ be the dimension, with $ 2 \\leq D \\leq 500 $.  \nLet $ \\mathbf{p} = (p_1, p_2, \\dots, p_D) $ and $ \\mathbf{q} = (q_1, q_2, \\dots, q_D) $ be two points in $ \\mathbb{R}^D $, where $ p_i, q_i \\in \\mathbb{Z} $ and $ -5000 \\leq p_i, q_i \\leq 5000 $ for all $ i \\in \\{1, \\dots, D\\} $.\n\n**Constraints**  \n1. $ 2 \\leq D \\leq 500 $  \n2. $ p_i, q_i \\in \\mathbb{Z} $ and $ -5000 \\leq p_i, q_i \\leq 5000 $ for all $ i \\in \\{1, \\dots, D\\} $\n\n**Objective**  \nCompute the Euclidean distance $ d(\\mathbf{p}, \\mathbf{q}) $:  \n$$\nd(\\mathbf{p}, \\mathbf{q}) = \\sqrt{\\sum_{i=1}^{D} (q_i - p_i)^2}\n$$","simple_statement":"Calculate the Euclidean distance between two points in D-dimensional space. Given the coordinates of both points, compute the distance using the formula: sqrt(sum of squared differences in each dimension). Print the exact result without rounding.","has_page_source":false}