WA in Stupid Machine

here is my code:
#include
#include
using namespace std;

int main() {
int n;
cin>>n;
for(int i=0;i<n;i++){
int t;
cin>>t;
int arr[t];
for(int j=0;j<t;j++){
cin>>arr[j];
}
int* i1;
i1 = std::min_element(arr, arr + t);
int a=i1;
int l;
for(int k=0;k<t;k++){
if(arr[k]==a){
l=k;
break;
}
}
cout<<(a
t)+(l)<<endl;
}
return 0;
}

your approach is not correct. I suggest you to read question again.You can perform the operation any no. of times(as per question).
One of the many cases in which your code will fail->1
3
4 1 2
expected output==> 6
your output ==>4
I suggest you to try it yourself
else u can see my neat and clear solution==>CodeChef: Practical coding for everyone