help needed in TRIPLETS

I am getting WA ans on majority test cases of this problem . Can someone please look into my code and tell me what is the error in my logic.problem
my code.

hmm, I am the same my code

https://discuss.codechef.com/questions/101517/sumq-editorial
check it

Variable named hell xD

1 Like

you are using three nested loops which causes timeout

yeah, I don’t know how to optimize away that part, I am bad at optimization