uva-10891.cpp