{"raw_statement":[{"iden":"problem statement","content":"E869120 is initially standing at the origin $(0, 0)$ in a two-dimensional plane.\nHe has $N$ engines, which can be used as follows:\n\n*   When E869120 uses the $i$\\-th engine, his $X$\\- and $Y$\\-coordinate change by $x_i$ and $y_i$, respectively. In other words, if E869120 uses the $i$\\-th engine from coordinates $(X, Y)$, he will move to the coordinates $(X + x_i, Y + y_i)$.\n*   E869120 can use these engines in any order, but each engine can be used at most once. He may also choose not to use some of the engines.\n\nHe wants to go as far as possible from the origin. Let $(X, Y)$ be his final coordinates. Find the maximum possible value of $\\sqrt{X^2 + Y^2}$, the distance from the origin."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   $-1 \\ 000 \\ 000 \\leq x_i \\leq 1 \\ 000 \\ 000$\n*   $-1 \\ 000 \\ 000 \\leq y_i \\leq 1 \\ 000 \\ 000$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$x_1$ $y_1$\n$x_2$ $y_2$\n $:$ $:$\n$x_N$ $y_N$"},{"iden":"sample input 1","content":"3\n0 10\n5 -5\n-5 -5"},{"iden":"sample output 1","content":"10.000000000000000000000000000000000000000000000000\n\nThe final distance from the origin can be $10$ if we use the engines in one of the following three ways:\n\n*   Use Engine $1$ to move to $(0, 10)$.\n*   Use Engine $2$ to move to $(5, -5)$, and then use Engine $3$ to move to $(0, -10)$.\n*   Use Engine $3$ to move to $(-5, -5)$, and then use Engine $2$ to move to $(0, -10)$.\n\nThe distance cannot be greater than $10$, so the maximum possible distance is $10$."},{"iden":"sample input 2","content":"5\n1 1\n1 0\n0 1\n-1 0\n0 -1"},{"iden":"sample output 2","content":"2.828427124746190097603377448419396157139343750753\n\nThe maximum possible final distance is $2 \\sqrt{2} = 2.82842...$. One of the ways to achieve it is:\n\n*   Use Engine $1$ to move to $(1, 1)$, and then use Engine $2$ to move to $(2, 1)$, and finally use Engine $3$ to move to $(2, 2)$."},{"iden":"sample input 3","content":"5\n1 1\n2 2\n3 3\n4 4\n5 5"},{"iden":"sample output 3","content":"21.213203435596425732025330863145471178545078130654\n\nIf we use all the engines in the order $1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 \\rightarrow 5$, we will end up at $(15, 15)$, with the distance $15 \\sqrt{2} = 21.2132...$ from the origin."},{"iden":"sample input 4","content":"3\n0 0\n0 1\n1 0"},{"iden":"sample output 4","content":"1.414213562373095048801688724209698078569671875376\n\nThere can be useless engines with $(x_i, y_i) = (0, 0)$."},{"iden":"sample input 5","content":"1\n90447 91000"},{"iden":"sample output 5","content":"128303.000000000000000000000000000000000000000000000000\n\nNote that there can be only one engine."},{"iden":"sample input 6","content":"2\n96000 -72000\n-72000 54000"},{"iden":"sample output 6","content":"120000.000000000000000000000000000000000000000000000000\n\nThere can be only two engines, too."},{"iden":"sample input 7","content":"10\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20"},{"iden":"sample output 7","content":"148.660687473185055226120082139313966514489855137208"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}