
Triangle 
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB 
Total submit users: 29, Accepted users: 28 
Problem 10533 :
No special judgement

Problem description 
A lattice point is an ordered pair (x, y) where x
and y are both integers. Given the coordinates of the vertices of a
triangle (which happen to be lattice points), you are to count the number of
lattice points which lie completely inside of the triangle (points on the edges
or vertices of the triangle do not count).

Input 
The input test file will contain multiple test cases. Each input test case
consists of six integers x_{1}, y_{1}, x_{2},
y_{2}, x_{3}, and y_{3}, where (x_{1},
y_{1}), (x_{2}, y_{2}), and (x_{3},
y_{3}) are the coordinates of vertices of the triangle. All
triangles in the input will be nondegenerate (will have positive area), and
−15000 ¡Ü x_{1}, y_{1}, x_{2}, y_{2},
x_{3}, y_{3} ¡Ü 15000. The endoffile is marked by
a test case with x_{1} = y_{1} = x_{2}
= y_{2} = x_{3} = y_{3} = 0 and
should not be processed.

Output 
For each input case, the program should print the number of internal lattice points on a single line.

Sample Input 
0 0 1 0 0 1
0 0 5 0 0 5
0 0 0 0 0 0

Sample Output 
0
6

Problem Source 
jiyanmoyu

Submit
Discuss
Judge Status
Problems
Ranklist

