Note : I regret and apologize my mistake for posting this solution during the contest.......
I am a complete beginner at competitive programming and didn't know that posting solutions during the contest is not correct ....
I apologize to the whole @codechef community and everyone affected by my fault 😔
From my next uploads i will be posting the explanation for the questions.....so that i could of some help to everyone.....
I have already deleted many of my uploaded solutions but I am not able to delete some due to technical issues.....
Hope u can understand.....