Puzzle solver for a problem of "3 rice eaters"