URI Online Judge Solution |1038 Snack

Here I tried to write everything in standard C++