Right sample test case still wrong answer

please check why is this giving the wrong answer. when it is giving the right answer for the sample cases.

#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
for(int i =0;i<n;i++){
int len;
cin>>len;
vector<pair<int,int>> v(len);
for (int f=0; f<len; f++){
int a,b;
cin>>a>>b;
v[f].first=a;
v[f].second=b;

		 }
	 sort(v.begin(), v.end());
	 int count =len;
	 for(int f=0 ; f<len-1 ; f++){
		 if(v[f].first<=v[f+1].first && v[f+1].first<=v[f].second){
			 count--;
		 }
	 
		


	 }
	 cout<<count<<" ";
	


}
return 0;

}

Save your code on ide.codingblocks.com and then share its link.

Consider a case:
1
25
37 45
75 76
76 91
64 78
10 53
13 24
94 99
89 92
82 84
77 87
65 73
55 77
43 99
32 37
90 95
30 53
97 99
77 91
93 99
13 64
26 51
7 39
31 50
11 14
33 79

The output must be 8.(but your code gives 3)
It is formed by picking activities:
32 37
37 45
65 73
75 76
82 84
89 92
97 99

Refer this https://ide.codingblocks.com/s/283247

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.