Showing run time error

#include<bits/stdc++.h>
using namespace std;
int main() {
int arr[100],n,t;

cin >> t;

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

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

	next_permutation(arr, arr+n);

	for(int i = 0; i < n; i++){
		cout << arr[i] << " ";
	}
	cout << endl;
}

}

According to constraints of the question there can be 1000 elements in arra\y but u are taking the array of max size 100.