Https://www.codechef.com/viewsolution/52680330

https://www.codechef.com/viewsolution/52680330

I am getting expected output but then also verdict is WRONG ANSWER

Please run this code let me know if any TEST CASE is not working.