changed the o/p format
added problem 3