Lui and Lines

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Lui is a magician, and recently he mastered traveling in nn-dimensional space. In order to adjust the settings of his new multidimensional spaceship, he has to find the distance between two lines in nn-dimensional space. Each line is defined by two distinct points lying on it. The distance between lines is the smallest distance between a pair of points (x,y)(x, y) such that xx lies on the first line and yy lies on the second one.

The distance between the points (x_1,,x_n)(x\_1, \ldots, x\_n) and (y_1,,y_n)(y\_1, \ldots, y\_n) in nn-dimensional space is defined as _i=1n(x_iy_i)2.\sqrt{\sum\_{i=1}^n (x\_i - y\_i)^2}\text{.}

The nn-dimensional line containing two points aa and bb could be formally defined as the set of points (ta_1+(1t)b_1,ta_2+(1t)b_2,,ta_n+(1t)b_n)(t a\_1 + (1-t)b\_1, t a\_2 + (1-t)b\_2, \ldots, t a\_n + (1-t)b\_n) for all real values of tt.

입력

The first line contains the integer nn (1n100,0001 \le n \le 100\\,000), the number of dimensions. The next four lines contain the description of four points aa, bb, cc, dd in nn-dimensional space. The points aa and bb lie on the first line, and the points cc and dd lie on the second one (aba \neq b, cdc \neq d). Each of these four lines contains nn integers. All the numbers in the input do not exceed 10510^5 by absolute value.

출력

Let dd be the distance between the lines. Print d2d^2 as a fraction $x$/$y$ such that x0x \ge 0, y>0y > 0, and the greatest common divisor of xx and yy is equal to 11.