cpp implementation of N Queens