eolymp
bolt
Try our new interface for solving problems
Məsələlər

Jungle Outpost

Jungle Outpost

There is a military base lost deep in the jungle. It is surrounded by n watchtowers with ultrasonic generators. In this problem watchtowers are represented by points on a plane. Watchtowers generate ultrasonic field and protect all objects that are strictly inside the towers' convex hull. There is no tower strictly inside the convex hull and no three towers are on a straight line. The enemy can blow up some towers. If this happens, the protected area is reduced to a convex hull of the remaining towers. \includegraphics{https://static.e-olymp.com/content/79/792e410cfe6c9fb8854fb30597ed824ef1ca5121.jpg} The base commander wants to build headquarters inside the protected area. In order to increase its security, he wants to maximize the number of towers that the enemy needs to blow up to make the headquarters unprotected. \InputFile The first line contains a single integer \textbf{n} (\textbf{3} ≤ \textbf{n} ≤ \textbf{50000})  the number of watchtowers. The next \textbf{n} lines contain the Cartesian coordinates of watchtowers, one pair of coordinates per line. Coordinates are integer and do not exceed \textbf{10^6} by absolute value. Towers are listed in the order of traversal of their convex hull in clockwise direction. \OutputFile Print the number of watchtowers the enemy has to blow up to compromise headquarters protection if the headquarters are placed optimally.
Zaman məhdudiyyəti 2 saniyə
Yaddaşı istafadə məhdudiyyəti 256 MiB
Giriş verilənləri #1
3
0 0
50 50
60 10
Çıxış verilənləri #1
1