I tried Sieve of Erastos and did the following code, I am getting WA for 1 1000000 test case, I have used ll long long , please help me with it.

```
using namespace std;
#define vs vector<string>
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define dqi deque<int>
#define pqL priority_queue<int,vector<int>,less<int>>
#define pqG priority_queue<int,vector<int>,greater<int>>
#define printKickstartSingle(T,ans) cout<<"Case #"<<T<<": "<<ans<<endl;
#define printKickstartArray(T,arr) cout<<"Case #"<<T<<": "; for(auto ele:arr) cout<<ele<<" "; cout<<endl;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define all(arr) arr.begin() , arr.end()
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MAX 1000000+1
#define MOD 1000000007
bool primes[MAX]={false};
typedef long long ll;
void seive(int l,int r,ll *ans){
primes[0]=false;
primes[1]=false;
int i=2;
while (i<MAX)
{
vi arr;
if(primes[i]==false){
int j=2;
while(i*j<MAX){
primes[i*j]=true;
if(i*j<=r&&i*j>=l)
arr.push_back(i*j);
j++;
}
}
/*cout<<"factors :"<<i<<" : ";
for(auto ele:arr){
cout<<ele<<" ";
}
cout<<endl;*/
int size=arr.size();
*ans=((ll)*ans+((ll)size*(ll)(size-1)/2));
for(auto ele:arr){
int q=r/ele;
if(q>1)
*ans=((ll)*ans-(((ll)q*(ll)(q-1))/2));
}
i++;
/* code */
}
}
void solveE(){
int l,r;
cin>>l>>r;
ll ans=0;
seive(l,r,&ans);
cout<<((ll )ans*2)<<endl;
}
int main(){
fastIO
solveE();
return 0;
}
```