Getting Wrong Output for this Question

For this Q:-

https://www.codechef.com/AUG20B/problems/CRDGAME3

( It’s a Q of August Long Challenge of CodeChef which was finished on 17th August. It’s not a Q of live contest )

This is my code:-

But for this code when I run it using the sample input, it’s getting executed successfully but it’s not showing any output.

I tried many times, can you please tell me what are the errors in my code so that this issue can be resolved.

I think you have not read question properly.There is no need to generate random numbers.


This is my solution for the same question