### My issue

I’m getting problem in runtime error so can anyone discuss the answer with me

### My code

```
#include <iostream>
using namespace std;
int main() {
int t,n,k,num,den;
cin>>t;
while(t--){
cin>>n>>k;
int Fx[n];
for(int i=0;i<=n;i++){
num = (i % k) ;
den = ((n-i) % k);
Fx[i] = num * den;
}
int max = 0,index;
for(int i=0;i<=n;i++){
if(Fx[i] >= max){
max = Fx[i];
index = i;
}
}
cout<<index<<endl;
}
return 0;
}
```

Problem Link: MAXIMALEXP Problem - CodeChef