added code for Uva:156
Merge pull request #7 from rahulroot/156-code

added code for Uva:156