Update uva-107.cpp