0){ $todayWork = floor($work / pow($day,2)); $work -= $todayWork; if($day == 1){ echo $todayWork; break; } $day--; } // your code goes here