added code for Uva:11498
Merge pull request #21 from rahulroot/11498-code

added code for Uva:11498