CHEFRECP,Getting Wrong answer

probelm:- CodeChef: Practical coding for everyone
My code :- CodeChef: Practical coding for everyone
Please can you tell me which test cases am I failing .

As per the constraints, no. of As is in long long int range but in your question, number of elements can’t be greater than 1000. So any test case with large n will fail. Hope it helps.
My submission: CodeChef: Practical coding for everyone

Thank you.
But sorry I didn’t understand as per the question the told N is >=1 and <=1000. Then why isn’t “int” enough. I’ve updated my code for the following changes you mentioned.Still it’s failing some testcases.Please can you tell me where did I go wrong?

please someone reply.