I wrote a code for Maximum circles problem but the output coming is wrong

#include <bits/stdc++.h>
using namespace std;

bool compare(pair<long long int,long long int> p1,pair<long long int,long long int> p2)
{

return (p1.second<p2.second);

}

int main()
{
long long int i,n;
cin>>n;

vector <pair<long long int,long long int>> v;

for(long long int i=0;i<n;i++)
{
	long long int e,s,c,r;
	cin>>c>>r;
	s=c-r;
	e=c+r;
	v.push_back(make_pair(s,e));
}	

//sort the 
sort(v.begin(),v.end(),compare);

//asli algo
long long int res=0;
long long int fin=v[0].second;

for(long long int i=1;i<n;i++);
{
	if(v[i].first >= fin)
	{
		fin=v[i].second;
	}
	else
	res++;
}
cout<<res<<endl;
return 0;

}

Here’s the code I wrote.
please help me in finding the error in my approach.

Hello @Pritamxyz,

Please share your code using some IDE.
The way you have shared it may cause many syntax errors to it.
Waiting for your code.

sir i have figured out my mistake and have got the correct answer.
Thank you sir

Great @Pritamxyz,

You should always try to debug your codes yourself first.
This helps in building many concepts that you might not learn otherwise.

Please, mark it as resolved.