Language: C++

#include <iostream>
using namespace std;

int main() {
long long n, a, b, c, d;
cin >> n >> a >> b >> c >> d;

cout << ((b <= a + d * (n - 1 ) && b >= a - d * (n - 1)? "YES" : "NO") << endl;

return 0;
}
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <random>
#include <string>
#include <bitset>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <cstring>
#include <cstdlib>
#include <cctype>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define FORR(i, m, n) for(int i = m; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define INF 999999999

using namespace std;

typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[] = {0, -1, 0, 1};
int dx[] = {1, 0, -1, 0};

llong pow(int x, int n) {
    llong ans = x;
    if (n == 0) return 1;

    for(int i = 0; i < n - 1; i++) {
        ans *= x;
    }

    return ans;
}

void swap(int *X, int *Y){
    int t = *X; *X = *Y; *Y = t;
}

const static int MAX = 500;

int h, w;
char field[MAX][MAX];
bool flag = false, visited[MAX][MAX] = {false};

void dfs(int i, int j) {
    if (field[i][j] == 'g') {
        flag = true;
        return;
    }
    if (visited[i][j]) return;
    visited[i][j] = true;

    rep(k, 4) {
        if (0 <= i + dx[k] && i + dx[k] <= h - 1 && 0 <= j + dy[k] && j + dy[k] <= w - 1 && field[i + dx[k]][j + dy[k]] != '#') {
            dfs(i + dx[k], j + dy[k]);
        }
    }
}

int main(){
int n,a,b,c,d;
cin>>n>>a>>b>>c>>d;
if(b >= a -d*(n-1) &&  b <= a + d*(n-1)) {cout << “YES” << endl;
}else {
cout << “NO” << endl;
}

return 0;
}


Compiler output:
a.cc:89:51: error: extended character “ is not valid in an identifier
   89 | if(b >= a -d*(n-1) &&  b <= a + d*(n-1)) {cout << “YES” << endl;
      |                                                   ^
a.cc:89:51: error: extended character ” is not valid in an identifier
a.cc:91:9: error: extended character “ is not valid in an identifier
   91 | cout << “NO” << endl;
      |         ^
a.cc:91:9: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:72: error: invalid operands of types 'const char*' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 | cout << ((b <= a + d * (n - 1 ) && b >= a - d * (n - 1)? "YES" : "NO") << endl;
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:8:79: error: expected ')' before ';' token
    8 | cout << ((b <= a + d * (n - 1 ) && b >= a - d * (n - 1)? "YES" : "NO") << endl;
      |         ~                                                                     ^
      |                                                                               )
a.cc: At global scope:
a.cc:86:5: error: redefinition of 'int main()'
   86 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:89:51: error: '\U0000201cYES\U0000201d' was not declared in this scope
   89 | if(b >= a -d*(n-1) &&  b <= a + d*(n-1)) {cout << “YES” << endl;
      |                                                   ^~~~~
a.cc:91:9: error: '\U0000201cNO\U0000201d' was not declared in this scope
   91 | cout << “NO” << endl;
      |         ^~~~