CHEF AND SQUARES DSA

[CodeChef: Practical coding for everyone]
(CodeChef: Practical coding for everyone)

Why Iam getting WA for the 2nd subtask???