offset count(*) / N columns

I do some job in few machines.
Need divide rows into equal parts for each machine.
Query with all conditions performed long time.
Is it possible to do this without additional request count(*), in one query.
Some like this: