#include #include #include #include #include using namespace std; const double eps=1e-9; int dcmp(double x){if(x<-eps) return -1;return x>eps;} struct point3 { double x,y,z; point3(double x=0,double y=0,double z=0):x(x),y(y),z(z){} void read(){int xt,yt,zt;scanf("%d %d %d",&xt,&yt,&zt);x=xt;y=yt;z=zt;} }; point3 operator -(point3 a,point3 b){return point3(a.x-b.x,a.y-b.y,a.z-b.z);} point3 operator *(point3 a,double b){return point3(a.x*b,a.y*b,a.z*b);} bool operator <(point3 a,point3 b){return a.x1&&dcmp(cross(ch[m-1]-ch[m-2],p[i]-ch[m-2]))<=0) --m; ch[m++]=p[i]; } int k=m; for(int i=n-2;i>=0;i--) { while(m>k&&dcmp(cross(ch[m-1]-ch[m-2],p[i]-ch[m-2]))<=0) --m; ch[m++]=p[i]; } if(n>1) --m; return m; } int n,m; double a,b,c,d; point3 p[105],p0,q[105],ch[105]; int main() { int i,j; int at,bt,ct,dt; while(scanf("%d %d %d %d",&at,&bt,&ct,&dt)!=EOF&&(at||bt||ct||dt)) { a=at,b=bt,c=ct,d=dt; scanf("%d",&n); for(i=0;i0) p[i]=p[i]*(d/te),++nt; } if(nt==0) printf("ZERO\n"); else if(nt=0) break; } if(j>=nt) {++rt;/*cout<