uva-1349.cpp