Bug with bad result with some threads count fixed: root cause in integer division without remainder when generating tasks regions