Resolvendo 1249.
Resolvendo 4a do Codeforces.