Can anyone provide the test cases where this question is getting wrong ans

https://www.codechef.com/LTIME89B/problems/COPAR
And i also want to mention i have seen the python code also with this logic getting AC.
code in cpp:

``````#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
using namespace std;
int gcd(int a,int b){
if (a == 0)
return b;
if(b==0)
return 0;
return gcd(b % a, a);
}
int d(vector<int> a,int j,int n){
int x=1;
for(int i=j;i<n;i++)
x=(x*a[i]);
return x;
}
int solve(vector<int> a,int n){
for(int i=0;i<n-1;i++){
int l=d(a,0,i+1),r=d(a,i+1,n);
if(gcd(l,r)==1){
return i+1;
}
}
return -1;
}
int32_t main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int>a(n);
rep(i,0,n)
cin>>a[i];
int x=solve(a,n);
if(x!=-1)
cout<<x<<'\n';
}
}
``````

code in python:

``````def prod(myList) :
result = 1
for x in myList:
result = result * x
return result

def d(a, b):

if a == 0:
return b
return d(b % a, a)

def L(n, seq):
for i in range(n-1):
a = prod(seq[:i+1])
b = prod(seq[i+1:])
if d(a, b) == 1:
return i + 1
else:
continue

T = int(input())
for _ in range(T):
n = int(input())
sequence = list(map(int, input().split()))

print(L(n, sequence))
``````

Overflow.
Multiplying will exceed 10^18 which is max limit of long long int

if i apply unsigned long long int it also says wrong ans.

You cannot store it in any data type. Check the constrains for 25 points.
A_i<=10^5 and N<=200.
Even if you put N=100 and all A_i=10^5, it would be 10^5 100 times would be much more than any limit of data type.
Since python has no such limit on number, hence it is being accepted in python