how can this not be accepted (POSPROD)?

#include <iostream>
using namespace std;

int main() {
	int t;
	cin >> t;
	while(t--){
	    int n,sum = 0,pos = 0,neg = 0;
	    cin >> n;
	    int * arr = new int[n];
	    for(int i = 0; i < n; i++){
	        cin >> arr[i];
	        if(arr[i] == 0){
	            continue;
	        }
	        else if(arr[i] < 0)
	        neg++;
	        else
	        pos++;
	    }
	    
	    for(int i = 0; i < n; i++){
	        if(arr[i] == 0){
	            continue;
	        }
	        else if(arr[i] > 0){
	            pos--;
	            sum = sum + pos;
	        }
	        else{
	            neg--;
	            sum = sum + neg;
	        }
	    }

		cout << pos << neg << endl;
	    
	    cout << sum << endl;
	}
	return 0;
}

how this code fails last 2 cases ?

SAME things happen in my code i dont get any test cases

Hey @anon14547936 :wave:
There is the problem of integer overflow in your code as max value of n is 10^5 which will form max pair about 10^10. try using long long in your code instead of int.