uva-11374.cpp