Language: C++

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pvec;

typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector<string> svec;
typedef vector< vector<string> > smat;

ll lcm(ll x, ll y){ 
    if (x % y == 0) return y;
    else return lcm(y, x%y);
}

ll gcd(ll x, ll y){
    ll l = lcm(x, y);
    return (x*y/l);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll g = gcd(fmax(c, d), fmin(c, d));
    ll rc = a%c, rd = a%d, rcd = a%g;
    ll dif = b-a;
    ll cnt=0;
    if(dif>=c-rc)cnt+=(dif-(c-rc))/c + 1;
    if(dif>=d-rd)cnt+=(dif-(d-rd))/d + 1;
    if(dif>=g-rcd)cnt-=(dif-(g-rcd))/g + 1; 
    if(rc==0)cnt++;
    if(rd==0)cnt++;
    if(rcd==0)cnt--;




    ll ans = dif + 1 - cnt;
    cout << ans << endl;

}

Compiler output:
a.cc:1:9: error: 'vector' does not name a type
    1 | typedef vector<bool> bvec;
      |         ^~~~~~
a.cc:2:9: error: 'vector' does not name a type
    2 | typedef vector<int> ivec;
      |         ^~~~~~
a.cc:3:9: error: 'vector' does not name a type
    3 | typedef vector<long long> lvec;
      |         ^~~~~~
a.cc:4:9: error: 'vector' does not name a type
    4 | typedef vector<double> dvec;
      |         ^~~~~~
a.cc:5:9: error: 'vector' does not name a type
    5 | typedef vector<pa> pvec;
      |         ^~~~~~
a.cc:7:9: error: 'vector' does not name a type
    7 | typedef vector< vector<bool> > bmat;
      |         ^~~~~~
a.cc:8:9: error: 'vector' does not name a type
    8 | typedef vector< vector<int> > imat;
      |         ^~~~~~
a.cc:9:9: error: 'vector' does not name a type
    9 | typedef vector<string> svec;
      |         ^~~~~~
a.cc:10:9: error: 'vector' does not name a type
   10 | typedef vector< vector<string> > smat;
      |         ^~~~~~
a.cc:12:1: error: 'll' does not name a type
   12 | ll lcm(ll x, ll y){
      | ^~
a.cc:17:1: error: 'll' does not name a type
   17 | ll gcd(ll x, ll y){
      | ^~
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope
   23 |     cin.tie(0);
      |     ^~~
a.cc:24:5: error: 'ios' has not been declared
   24 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:25:5: error: 'll' was not declared in this scope
   25 |     ll a, b, c, d;
      |     ^~
a.cc:26:12: error: 'a' was not declared in this scope
   26 |     cin >> a >> b >> c >> d;
      |            ^
a.cc:26:17: error: 'b' was not declared in this scope
   26 |     cin >> a >> b >> c >> d;
      |                 ^
a.cc:26:22: error: 'c' was not declared in this scope
   26 |     cin >> a >> b >> c >> d;
      |                      ^
a.cc:26:27: error: 'd' was not declared in this scope
   26 |     cin >> a >> b >> c >> d;
      |                           ^
a.cc:27:7: error: expected ';' before 'g'
   27 |     ll g = gcd(fmax(c, d), fmin(c, d));
      |       ^~
      |       ;
a.cc:28:7: error: expected ';' before 'rc'
   28 |     ll rc = a%c, rd = a%d, rcd = a%g;
      |       ^~~
      |       ;
a.cc:29:7: error: expected ';' before 'dif'
   29 |     ll dif = b-a;
      |       ^~~~
      |       ;
a.cc:30:7: error: expected ';' before 'cnt'
   30 |     ll cnt=0;
      |       ^~~~
      |       ;
a.cc:31:8: error: 'dif' was not declared in this scope
   31 |     if(dif>=c-rc)cnt+=(dif-(c-rc))/c + 1;
      |        ^~~
a.cc:31:15: error: 'rc' was not declared in this scope
   31 |     if(dif>=c-rc)cnt+=(dif-(c-rc))/c + 1;
      |               ^~
a.cc:31:18: error: 'cnt' was not declared in this scope; did you mean 'int'?
   31 |     if(dif>=c-rc)cnt+=(dif-(c-rc))/c + 1;
      |                  ^~~
      |                  int
a.cc:32:8: error: 'dif' was not declared in this scope
   32 |     if(dif>=d-rd)cnt+=(dif-(d-rd))/d + 1;
      |        ^~~
a.cc:32:15: error: 'rd' was not declared in this scope
   32 |     if(dif>=d-rd)cnt+=(dif-(d-rd))/d + 1;
      |               ^~
a.cc:32:18: error: 'cnt' was not declared in this scope; did you mean 'int'?
   32 |     if(dif>=d-rd)cnt+=(dif-(d-rd))/d + 1;
      |                  ^~~
      |                  int
a.cc:33:8: error: 'dif' was not declared in this scope
   33 |     if(dif>=g-rcd)cnt-=(dif-(g-rcd))/g + 1;
      |        ^~~
a.cc:33:13: error: 'g' was not declared in this scope
   33 |     if(dif>=g-rcd)cnt-=(dif-(g-rcd))/g + 1;
      |             ^
a.cc:33:15: error: 'rcd' was not declared in this scope
   33 |     if(dif>=g-rcd)cnt-=(dif-(g-rcd))/g + 1;
      |               ^~~
a.cc:33:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |     if(dif>=g-rcd)cnt-=(dif-(g-rcd))/g + 1;
      |                   ^~~
      |                   int
a.cc:34:8: error: 'rc' was not declared in this scope
   34 |     if(rc==0)cnt++;
      |        ^~
a.cc:34:14: error: 'cnt' was not declared in this scope; did you mean 'int'?
   34 |     if(rc==0)cnt++;
      |              ^~~
      |              int
a.cc:35:8: error: 'rd' was not declared in this scope
   35 |     if(rd==0)cnt++;
      |        ^~
a.cc:35:14: error: 'cnt' was not declared in this scope; did you mean 'int'?
   35 |     if(rd==0)cnt++;
      |              ^~~
      |              int
a.cc:36:8: error: 'rcd' was not declared in this scope
   36 |     if(rcd==0)cnt--;
      |        ^~~
a.cc:36:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |     if(rcd==0)cnt--;
      |               ^~~
      |               int
a.cc:41:7: error: expected ';' before 'ans'
   41 |     ll ans = dif + 1 - cnt;
      |       ^~~~
      |       ;
a.cc:42:5: error: 'cout' was not declared in this scope
   42 |     cout << ans << endl;
      |     ^~~~
a.cc:42:13: error: 'ans' was not declared in this scope
   42 |     cout << ans << endl;
      |             ^~~
a.cc:42:20: error: 'endl' was not declared in this scope
   42 |     cout << ans << endl;
      |                    ^~~~