Language: C++

\#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repn(i,n) for(ll i=0;i<=(ll)(n);i++)
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);
ll n,a,b,c,d;

signed main(){
    cin>>n>>a>>b>>c>>d;
    n--;
    if(b<a)swap(a,b);
    b-=a;


    if(!c && !d){
      if(b==0)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
      return 0;
    }

    if(c==d){
      if(b%c==0)cout<<"YES"<<endl;
      else cout<<"NO"<<endl;
      return 0;
    }

    if((n)*(d-c)>=c+d){
      cout<<"YES"<<endl;
    }else{
     for(int i=0;i <= n;i++)
     {
       if(c*n-i*(c+d) <= b && b <= d*n-i*(c+d)){
         cout<<"YES"<<endl;
         return 0;
       }
     }
     cout<<"NO"<<endl; 
    }
}


Compiler output:
a.cc:1:1: error: stray '\' in program
    1 | \#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | \#include <bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | \#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:12:9: error: 'pair' does not name a type
   12 | typedef pair<int,int> P;
      |         ^~~~
a.cc:13:9: error: 'pair' does not name a type
   13 | typedef pair<ll,ll> PL;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:21:5: error: 'cin' was not declared in this scope
   21 |     cin>>n>>a>>b>>c>>d;
      |     ^~~
a.cc:23:12: error: 'swap' was not declared in this scope
   23 |     if(b<a)swap(a,b);
      |            ^~~~
a.cc:28:15: error: 'cout' was not declared in this scope
   28 |       if(b==0)cout<<"YES"<<endl;
      |               ^~~~
a.cc:28:28: error: 'endl' was not declared in this scope
   28 |       if(b==0)cout<<"YES"<<endl;
      |                            ^~~~
a.cc:29:12: error: 'cout' was not declared in this scope
   29 |       else cout<<"NO"<<endl;
      |            ^~~~
a.cc:29:24: error: 'endl' was not declared in this scope
   29 |       else cout<<"NO"<<endl;
      |                        ^~~~
a.cc:34:17: error: 'cout' was not declared in this scope
   34 |       if(b%c==0)cout<<"YES"<<endl;
      |                 ^~~~
a.cc:34:30: error: 'endl' was not declared in this scope
   34 |       if(b%c==0)cout<<"YES"<<endl;
      |                              ^~~~
a.cc:35:12: error: 'cout' was not declared in this scope
   35 |       else cout<<"NO"<<endl;
      |            ^~~~
a.cc:35:24: error: 'endl' was not declared in this scope
   35 |       else cout<<"NO"<<endl;
      |                        ^~~~
a.cc:40:7: error: 'cout' was not declared in this scope
   40 |       cout<<"YES"<<endl;
      |       ^~~~
a.cc:40:20: error: 'endl' was not declared in this scope
   40 |       cout<<"YES"<<endl;
      |                    ^~~~
a.cc:45:10: error: 'cout' was not declared in this scope
   45 |          cout<<"YES"<<endl;
      |          ^~~~
a.cc:45:23: error: 'endl' was not declared in this scope
   45 |          cout<<"YES"<<endl;
      |                       ^~~~
a.cc:49:6: error: 'cout' was not declared in this scope
   49 |      cout<<"NO"<<endl;
      |      ^~~~
a.cc:49:18: error: 'endl' was not declared in this scope
   49 |      cout<<"NO"<<endl;
      |                  ^~~~