NRWP MAY CHALLENGE Help

Problem link :

My solution using bitmasking:
https://www.codechef.com/viewsolution/33012919

So, i have used bitmasking to generate all possible array values where if ith bit is set then it means that ith element is set to positive else negative.

now as per the constraints my logic should atleast work for N<=15 or First Subtask. but it gives WA . can anyone give a case where my code fails under the contraints of first subtask?

your solution outputs 0 for the sign on some cases, but the sign should be 1 or -1.
Try this testcase for example:

2 1 2
1000
1000
1 1 0
2 1 0

Thanks a lot. i’ll fix it.