#include<iostream>
using namespace std;
int x[4];
int y[4];
int gcd(int a,int b)
{
if(b==0) return a;
else return gcd(b,a%b);
}
int main()
{
int area;
int b,i;
while(scanf("%d%d%d%d%d%d",x+1,y+1,x+2,y+2,x+3,y+3)!=EOF)
{
if(x[1]==0 && y[1]==0
&& x[2]==0 && y[2]==0
&& x[3]==0 && y[3]==0 ) break;
area=abs( (x[2]-x[1])*(y[3]-y[1])-(x[3]-x[1])*(y[2]-y[1]) );
b=gcd(abs(x[2]-x[1]),abs(y[2]-y[1]))+gcd(abs(x[3]-x[2]),abs(y[3]-y[2]))+gcd(abs(x[1]-x[3]),abs(y[1]-y[3]));
i=(area+2-b)>>1;
printf("%d\n",i);
}
return 0;
}
posted on 2009-10-06 18:28
wyiu 阅读(112)
评论(0) 编辑 收藏 引用 所属分类:
POJ