solved euler 12 in c++