UVa 424 resolvido