Solution of two CSP problems using backtracking