编程介的小学生 2017-08-30 13:13 采纳率: 20.5%
浏览 824
已采纳

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-09-14 16:19
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划