#P1227. [JSOI2008] 完美的对称

    ID: 227 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>模拟数学2008各省省选江苏排序

[JSOI2008] 完美的对称

Description

During the summit, many bodyguards are needed to protect the representatives of various countries. Besides their own personal bodyguards, the organizing committee also assigns additional agents and snipers to protect them. To make their work effective and maximize the safety of the protected person, bodyguards are deployed in all directions around the VIP.

The optimal standing positions for the bodyguards should be such that the protected person stands at the center of symmetry of all bodyguards. However, once the VIP moves, it becomes hard for the bodyguards to adjust their positions according to the VIP’s new location. Most agents cannot make this adjustment in real time.

Therefore, the Minister of Security decides to reverse the process: the bodyguards take their positions first, and then the VIP finds an appropriate position at their center of symmetry. If the VIP walks around freely, we are not responsible for his safety.

Your task is to automate this process. Given a set of NN points (the bodyguards’ positions), find their center of symmetry SS, where the VIP will be relatively safe. The definitions are as follows.

First, given a point AA and a center of symmetry SS, the point AA' is the image of AA with respect to SS, i.e., SS is the midpoint of segment AAAA'.

The image of a point set XX with respect to SS is the point set consisting of the images of all its points. The set XX admits a center of symmetry SS if the image of XX with respect to SS equals XX itself.

Input Format

The first line of input contains an integer NN, 1N200001\le N\le 20000. Each of the next NN lines contains two integers XiX_i and YiY_i, 105Xi,Yi105-10^5\le X_i,Y_i\le 10^5, giving the Cartesian coordinates of the ii-th point in the set.

No two bodyguards will stand at the same position, so any two points in the input are distinct. Note that a bodyguard may stand at the same position as the VIP.

Output Format

Output exactly one line. If the given set admits a center of symmetry, print $\texttt{V.I.P. should stay at (}x\texttt{,}y\texttt{).}$, where xx and yy are the coordinates of the center, rounded to one decimal place.

If the set has no center of symmetry, output This is a dangerous situation!. Make sure there is exactly one space between words and no extra spaces.

8
1 10
3 6
6 8
6 2
3 -4
1 0
-2 -2
-2 4

V.I.P. should stay at (2.0,3.0).

Hint

JSOI2008 Round 2.

Translated by ChatGPT 5