编程介的小学生 2017-10-29 09:15 采纳率: 20.5%
浏览 781
已采纳

Counting Grids

Problem Description
Small Ming is a lazy middle school student, one day, when he's doing his physics experiment, the teacher wants them to estimate the size of the molecule by Film Method(You Mo Fa). As is known to all, the experiment requires students to draw the outline of the Film(You MO). But Ming is so lazy that he doesn't want to draw the outline precisely. So he chooses some points on the grid plane whose coordinates are integers, and promise that , after connecting these points with segments in clock-wise, you can get a convex polygon P which contains the whole Film(You Mo). Lazy Ming wants to use polygon P represented the Film to complete his experiment. But for some reasons, he forgot the points he choose on the second day.The only thing he remeber is some points with integer coordinates on the Film(You Mo) that can perfectly describe the polygon P.Now as a TopCoder and a good friend of him, can you help him to calculate the number of grids on the Film(You Mo)?

Input
Mutilple cases. For every case, first line is an integer N(N<10^5), then N lines follow. Each line has 2 integers x and y, which describe a point on the grid plane(0<=x,y<=10^5).

Output
As described in the problem, you should calculate the number of the grids.

Sample Input
3
0 0
0 1
1 1

Sample Output
1

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器