Created
August 18, 2023 00:49
-
-
Save estelabn/e89b3d7fa6741447ebca1e2b540fbd53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int N,E,D; | |
cin >> N >> E >> D; | |
int resposta = -1; | |
for(int i=0; i<N; i++){ | |
int e,d; | |
cin >> e >> d; | |
int oculos = abs(E-e) + abs(D-d); | |
if(resposta == -1) resposta = oculos; | |
else resposta = min(resposta, oculos); | |
} | |
cout << resposta << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment