Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define SYNC ios::sync_with_stdio(0);
- #define F first
- #define S second
- #define endl '\n'
- using namespace std;
- using ll = long long int;
- using ii = pair<int, int>;
- using vii = vector<ii>;
- using vi = vector<int>;
- using graph = vector<vi>;
- const int INF = 0x3f3f3f3f;
- const int MAXN = 58;
- const ll mod = 1000000007;
- int main() {
- SYNC
- int n[5], k;
- string ans = "Yay!";
- for (auto &i : n) {
- cin >> i;
- }
- cin >> k;
- for (int i = 0; i < 5; i++) {
- for (int j = 0; j < 5; j++) {
- if (i == j) continue;
- if (abs(n[i] - n[j]) > k) {
- ans = ":(";
- break;
- }
- }
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment