added code for Uva:12015
Merge pull request #28 from rahulroot/12015-code

added code for Uva:12015