UVa 579 resolvido