added code for Uva:11799
Merge pull request #30 from rahulroot/11799-code

added code for Uva:11799