P1227 [JSOI2008] Perfect Symmetry

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 $N$ points (the bodyguards’ positions), find their center of symmetry $S$, where the VIP will be relatively safe. The definitions are as follows. First, given a point $A$ and a center of symmetry $S$, the point $A'$ is the image of $A$ with respect to $S$, i.e., $S$ is the midpoint of segment $AA'$. The image of a point set $X$ with respect to $S$ is the point set consisting of the images of all its points. The set $X$ admits a center of symmetry $S$ if the image of $X$ with respect to $S$ equals $X$ itself. ![](https://cdn.luogu.com.cn/upload/image_hosting/trym53o8.png)

Input Format

The first line of input contains an integer $N$, $1\le N\le 20000$. Each of the next $N$ lines contains two integers $X_i$ and $Y_i$, $-10^5\le X_i,Y_i\le 10^5$, giving the Cartesian coordinates of the $i$-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 $x$ and $y$ 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.

Explanation/Hint

JSOI2008 Round 2. Translated by ChatGPT 5