ABC097A - Colorful Transceivers
#include <cstdlib> #include <iostream> using namespace std; int main(void) { int a, b, c, d; cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b >> c >> d; if (abs(a - c) <= d || (abs(a - b) <= d && abs(b - c) <= d)) { cout << "Yes\n"; } else { cout << "No\n" << endl; } return 0; }