Update uva10340.cpp