void solve() {↵
int n, h, a, b, k;↵
cin >> n >> h >> a >> b >> k;↵
↵
for(int i = 0; i < k; i++) {↵
int t1, f1, t2, f2;↵
cin >> t1 >> f1 >> t2 >> f2;↵
if(t1 == t2) {↵
cout << std::abs(f1 - f2) << endl;↵
continue;↵
}↵
const auto d1 = std::abs(f1 - a) + std::abs(a - f2);↵
const auto d2 = std::abs(f1 - b) + std::abs(b - f2);↵
cout << std::min(d1, d2) + std::abs(t1 - t2) << endl;↵
}↵
}↵
↵
↵
How can the above code fail for [this problem](https://codeforces.net/problemset/problem/1020/A)
int n, h, a, b, k;↵
cin >> n >> h >> a >> b >> k;↵
↵
for(int i = 0; i < k; i++) {↵
int t1, f1, t2, f2;↵
cin >> t1 >> f1 >> t2 >> f2;↵
if(t1 == t2) {↵
cout << std::abs(f1 - f2) << endl;↵
continue;↵
}↵
const auto d1 = std::abs(f1 - a) + std::abs(a - f2);↵
const auto d2 = std::abs(f1 - b) + std::abs(b - f2);↵
cout << std::min(d1, d2) + std::abs(t1 - t2) << endl;↵
}↵
}↵
↵
↵
How can the above code fail for [this problem](https://codeforces.net/problemset/problem/1020/A)