# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1222303 | jakeob77 | Text editor (CEOI24_editor) | C++17 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ins insert
#define pb push_back
void solve(){
int n;cin>>n;
int st,stt,g,gg;cin>>st>>stt>>g>>gg;
vector<int>a(n);
for(int &d:a) cin>>d;
cout<<min(abs(st-g)+abs(stt-gg),1+(l[0]+1-gg))<<endl;
}
int main() {
int t=1;
while(t--)solve();
}