My code works fine on my computer but when I try submitting, i get a segmentation fault error? Can someone please tell me what i am doing wrong? It’d be a huge help. Thanks in advance.

https://www.codechef.com/viewsolution/22067284 (link to my code)

code//

#include

#include

#include

using namespace std;

#define ll long long

#define mod %(1000*1000*1000 +7)

#include<bits/stdc++.h>

#include

#include

int main(){

int T;

cin>>T;

```
while(T--){
ll sum =0;
string c;
cin>>c;
int len= c.length();
int n= stoi(c);
int i=0;
for(i;i<len;i++){
ll p= pow(10,len);
p=p%(1000*1000*1000 +7);
p=pow(p,len-i-1);
p=p%(1000*1000*1000 +7);
sum= (sum + (n*p));
sum=sum%(1000*1000*1000 +7);
if(len > 1)
rotate(c.begin(), c.begin()+1, c.end());
n=stoi(c);
//n = (n/10) + (n%10)*pow(10,len-1);
}
cout<<sum<<endl;
```

}

return 0;

}