adding solutions from 17 Nov contest of round 4