Not getting correct Answer

question: https://www.codechef.com/BYTR20B
my code: https://ide.codingblocks.com/s/396824
what’s wrong with my code?

Which problem name is the code for? There are 5 problems in this link.

Fisrst Question (CYBV)

See the editorial


You just had to print k/n nothing else.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

what is wrong with my approach??

You code was in O(N) whereas k/n is O(1) approach. Also do dry run for different test cases. You will get the intuition. Rest everything is right. Also i have mark this doubt as resolved. So if you want more help please post a new doubt .

Hello @samardeep you have reopened your doubt , @mr.encoder has guided you.
what is the issue?
please confirm.
Happy Learning!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.