F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Counting Grids

Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 125536/65536 K (Java/Others)
Total Submission(s): 239    Accepted Submission(s): 3


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
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-28 14:54:51, Gzip enabled