Can anyone tell me where this solution for 2nd problem is going wrong? https://www.codechef.com/viewsolution/16374117

p.s.- Its my friend’s code and he asked me to debug it after contest but i failed too

@soham1234. Why are you directly updating on index x%b where you have actually sorted the vector and messed up the data and the actual element may be somewhere else. I may be wrong again. Please verify.

n=1e5 for a particular testcase

Could Someone Please tell me why this particular solution is giving a wrong answer for the same problem?

https://www.codechef.com/viewsolution/16374812

i tried several methods but my answer was never accepted completely.Could Someone tell me the input for which it gives the wrong answer.??

Help of any kind would be highly appreciated.

Your product in num is overflowing. Use long long.

Can anyone tell me why my solution is giving wrong answer on subtask #2 but correct answer on subtasks #1 and #3. https://www.codechef.com/viewsolution/16377252