编程介的小学生 2017-04-06 16:34 采纳率: 20.5%
浏览 682
已采纳

Protect the King

A crowd of people are planning to kill the King, who has been tyrannical for years. The King asks a group of soldiers to protect him. The soldiers stand on the ground, but NO three or more soldiers stand in a single line and NO two of them are at the same point. Each two of them can connect themselves with an iron chain. When some soldiers connect themselves in a CLOSED iron chain circle, a circle of protection is formed. The soldiers can form one, two or more circles, and the King will stand inside all circles of protection, so that it's difficult for the people to break in. The picture below shows an example of "two circles of protection", the red circle indicating the supposed position of the King.

However, when iron chains of different protection circles cross each other, there may well be a chaos when the people try to break in, so it's NOT allowed that chains of different protection circles cross each other. Of course, the more circles of protection, the safer the King. Now given the coordinates of the soldiers, you are asked to calculate the maximal number of protection circles that can form.

Input

There are multiple cases(no more than 25). In each case, there's an integer n ( 2 < n <= 2000) in the first line, indicating the number of soldiers. The second line includes n pairs of integers xi, yi ( 0 <= xi, yi < 100000), indicating the position of the ith soldier.

Output

Print the maximal number of protection circles that can form in one line for each case.

Sample Input

4
0 0 0 1 1 0 1 1
8
0 0 8 0 8 3 0 3 2 1 2 2 3 2 3 1
Sample Output

1
2

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-20 15:42
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64