Jeremiah_

ABC_123 - A - Five Antennas

Jun 6th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define SYNC ios::sync_with_stdio(0);
  4. #define F first
  5. #define S second
  6. #define endl '\n'
  7.  
  8.  
  9. using namespace std;
  10.  
  11. using ll = long long int;
  12. using ii = pair<int, int>;
  13. using vii = vector<ii>;
  14. using vi = vector<int>;
  15. using graph = vector<vi>;
  16. const int INF = 0x3f3f3f3f;
  17. const int MAXN = 58;
  18. const ll mod = 1000000007;
  19.  
  20.  
  21.  
  22. int main() {
  23.     SYNC
  24.     int n[5], k;
  25.     string ans = "Yay!";
  26.     for (auto &i : n) {
  27.         cin >> i;
  28.     }
  29.     cin >> k;
  30.     for (int i = 0; i < 5; i++) {
  31.         for (int j = 0; j < 5; j++) {
  32.             if (i == j) continue;
  33.             if (abs(n[i] - n[j]) > k) {
  34.                 ans = ":(";
  35.                 break;
  36.             }
  37.         }
  38.     }
  39.     cout << ans << endl;
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment