added code for Uva:10004
Merge pull request #17 from rahulroot/10004-code

added code for Uva:10004