Getting error in sort game problem in challenges

#include
#include
#include
using namespace std;
bool compare(pair<string,int> p1,pair<string,int> p2){
if(p1.second == p2.second){
return p1.first < p2.first;
}else{
return p1.second > p2.second;
}
}
int main(){
int Max;
cin>>Max;
int n;
cin>>n;
vector<pair<string,int>> p;
for(int i=0;i<n;i++){
string x;
int y;
cin>>x>>y;
p.push_back(make_pair(x,y));
}
sort(p.begin(),p.end(),compare);

for(auto v:p){
 if( (v.second >= 1) && (v.second <=100)){
	 if(v.second > Max){
      cout<<v.first<<" "<<v.second<<endl;
	 }
 }

}
}

//where is the error in code

hi @abhinavakhil55 can you please save your code on ide.codingblocks.com and share the link? It gets messed up when you paste it here itself.

this is the link : https://ide.codingblocks.com/s/199408

Hi @abhinavakhil55 what is the error that you are getting? this code is running fine for me.

Hi @abhinavakhil55 please change the condition in line 28 to v.second >= Max and it will pass all the test cases.