Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include<bits/stdc++.h>
- #include<iostream>
- #include<vector>
- #define long long long
- #define nln '\n'
- using namespace std;
- // Global variables: a, d
- vector<long> a;
- long d;
- void data()
- {
- a.resize(3, 0);
- for (long i = 0; i != 3; ++i)
- cin >> a[i];
- cin >> d;
- }
- void process()
- {
- long max = -1;
- for (long i = 0; i != 2; ++i)
- for (long j = i+1; j != 3; ++j)
- {
- long tem = abs(a[i]-a[j]);
- if (tem > max)
- max = tem;
- }
- if (max > d)
- cout << "No";
- else
- cout << "Yes";
- }
- int main()
- {
- data();
- process();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment