Solve problem 57 using C++, Go, and Python.