for each i
if ( )
  if ( ) return (DISJOINT);
   ;
else if ( )
  if ( ) return (DISJOINT);
   ;
if ( ) return(DISJOINT);
return(OVERLAP);
Algorithm 1: