uva-1099.cpp