A solver and generator of KenKen puzzles