Simple C++ solutions for 38,41,52,53