add solution to PAT3-1