Vector of pair(algo ++)

#include<bits/stdc++.h>
using namespace std;
bool compare(pair<int,int>p1,pair<int,int>p2)
{
int dis1=p1.firstp1.first+p1.secondp1.second;
int dis2=p2.firstp2.first+p2.secondp2.second;
if(dis1==dis2)
return p1.first<p2.first;
else
return dis1<dis2;
}
int main()
{
int car,x,y;
cout<<“enter the no. of car”;
cin>>car;
vector<pair<int,int> > v;
for(int i=1;i<=car;i++)
{
cin>>x>>y;
v.push_back(make_pair(x,y));
}
sort(v.begin(),v.end(),compare);

     int i=1;
    for(auto p:v&&i<0)
    {
    cout<<p.first<<" "<<p.second;
    i--;
    }

}

how to print front most pair only