added code for Uva:630