Maximum length bitonic subarray

please correct the code…

#include
using namespace std;

int bitonic(int arr[], int n)
{

int inc[n];  
  
int dec[n];  
int i, max;  

inc[0] = 1;  


dec[n-1] = 1;  

for (i = 1; i < n; i++)  
inc[i] = (arr[i] >= arr[i-1])? inc[i-1] + 1: 1;  

for (i = n-2; i >= 0; i--)  
dec[i] = (arr[i] >= arr[i+1])? dec[i+1] + 1: 1;  


max = inc[0] + dec[0] - 1;  
for (i = 1; i < n; i++)  
    if (inc[i] + dec[i] - 1 > max)  
        max = inc[i] + dec[i] - 1;  

return max;  

}

int main()
{

int t;
int n;
cin>>t;
cin>>n;
int arr[n];
while(t–){
for(int i=0;i<n;i++){
cin>>arr[i];
}
cout<< bitonic(arr, n);
}

return 0;  

}

u arent taking the input correctly

int t;
int n;
cin >> t;
while (t--)
{

    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    cout << bitonic(arr, n);
}

t test cases
while(t–){

}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.