Solovay-Kitaev theorem in C++ (based on Python program by Paul Pham)