No.3042 Enlarged Copy
Problem Statement
The photos mentioned below are rectangular. The lower-left corner is taken as the origin, and along the edges of the photo
the $x$ coordinate is taken to the right and the $y$ coordinate upward. Coordinates are in units of $mm$.
There is a photo of stars. In it there are
$N$
stars, and their positions are
$(x_i, y_i) ~ (1 \le i \le N)$.
The photo was pasted onto another large white sheet of paper so that no star sticks out of the paper.
At this time, the orientation and position of the pasting were chosen very carelessly.
The white paper was then enlarged (reduction is also possible) with a copy machine and made into a photo.
As a result, the positions of the stars became
$(z_j, w_j) ~ (1 \le j \le N)$,
though not necessarily in the original order.
By what factor was the copy made? An absolute error of less than $10^{-3}$ is allowed.
Here, copying means a similarity enlargement centered at the lower-left corner of the white paper.
Input
$N$ $x_1\ y_1$ . . . $x_N\ y_N$ $z_1\ w_1$ . . . $z_N\ w_N$
$2 \le N \le 10^6$
$x_i, y_i, z_j, w_j ~ (1 \le i \le N, 1 \le j \le N)$
are decimals.
$(x_i, y_i) \neq (x_j, y_j) ~ (i \neq j)$
$0 \le x_i, y_i, z_j, w_j \le 10^9 ~ (1 \le i \le N, 1 \le j \le N)$
$(x_i, y_i)$ does not necessarily move to $(z_i, w_i)$.
Output
ansPrint a newline at the end.
Sample
Sample 1
Input
2 1 1 2 2 4 4 2 2
2
If we regard $(1, 1)$ as corresponding to $(2, 2)$ and $(2, 2)$ as corresponding to $(4, 4)$, we can consider that the photo was pasted so that its lower-left corner coincides with that of the white paper, and that a $2$-times copy was made. Note that, as in this example, the copy destinations do not necessarily match in the order of the input.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
nauclhlt
naniwazu