program main implicit none integer*8::N,i integer*8::xl,xh,yl,yh read *,N do i=1,N read *,xl,xh,yl,yh print '("SELECT count(*) FROM point WHERE ",i0," <= x AND x <= ",i0," & AND ",i0," <= y AND y <= ",i0)',xl,xh,yl,yh end do end program main