Discussion About Maximum Circles

This is Discussion thread about Maximum Circles

Continuing the discussion from Discussion About Maximum Circles:

This is the code, can someone tell me whats wrong , this is a greedy approach:
#include
using namespace std;
int main() {
int n;
cin>>n;
long long int c[n],r[n];
for(int i=0;i<n;i++){
cin>>c[i];
cin>>r[i];
}
/for(int i=0;i<n;i++){
cout<<c[i]<<" "<<r[i]<<endl;
}
/
int count=0,i=0,j=i+1;
while(j!=n){
if(c[j]-r[j]<c[i]+r[i]){
count++;
j=j+1;
}
else if(c[j]-r[j]>=c[i]+r[i]){
i=j;
j=j+1;
}
}
cout<<count;
}