ride.cpp: The main source code that implements my solution