Matching test cases but judge says "wrong answer" on DWNLD question

Okay, so the script runs fine on my PC but judge says the output is wrong. Can anyone please help me with this, I am new here…sorry if it is a noob question

Problem: https://www.codechef.com/problems/DWNLD

Code: https://www.codechef.com/viewsolution/22655644