Language: C++

const double EPS = 1e-6;

int cmp(double a, double b) {
    const double diff = a-b;
    if(fabs(diff) < EPS) return 0;
    return diff < 0 ? -1 : 1;
}

struct Rect {
    P lb, rt;

    Rect() {}
    Rect(const P &lb, const P &rt) : lb(lb), rt(rt) {}

    double top() const { return rt.imag(); }
    double bottom() const { return lb.imag(); }
    double left() const { return lb.real(); }
    double right() const { return rt.real(); }
};

double calc(double t, double vy) {
    return -4.9*t*t + vy*t;
}

bool shoot(double vx, double vy, const vector<Rect> &rects, double X, double Y) {
    if(cmp(vx, 0) == 0) {
        return cmp(Y, 0) == 0;
    }
    // Xテ・ツ慊ーテァツつケテ」ツ?ァYテ、ツクツ甘ァツゥツコテ」ツ?ォテ」ツ??」ツつ嘉」ツつ古」ツ?ェテ」ツ??
    if(cmp(calc(X / vx, vy), Y) < 0) return false;

    const double top_t = vy / 9.8;
    const double top_x = vx * top_t;
    const double top_y = calc(top_t, vy);
    for(const Rect &r : rects) {
        const double y_left = calc(r.left()/vx, vy);
        const double y_right = calc(r.right()/vx, vy);
        // Crash into left wall
        if(cmp(r.bottom(), y_left) < 0 && cmp(y_left, r.top()) < 0) return false;
        // Crash into right wall
        if(cmp(r.bottom(), y_right) < 0 && cmp(y_right, r.top()) < 0) return false;
        // Crash into top wall
        if(cmp(y_left, r.top()) >= 0) {
            if(cmp(y_right, r.top()) < 0) return false;
        }
        // Crash into bottom wall
        if(cmp(y_left, r.bottom()) <= 0) {
            if(cmp(y_right, r.bottom()) > 0) return false;
        }
        // Crash into bottom wall(2)
        if(cmp(r.left(), top_x) < 0 && cmp(top_x, r.right()) < 0) {
            if(cmp(y_left, r.bottom()) <= 0
                && cmp(y_right, r.bottom()) <= 0
                && cmp(top_y, r.bottom()) > 0) return false;
        }
    }
    return true;

}
bool check(const P &aim, const vector<Rect> &rects, double V, double X, double Y) {
    const double a = norm(aim);
    const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
    const double c = 4.9*4.9*pow(aim.real(), 4);
    const double D = b*b - 4*a*c;
    //cout << D << endl;
    if(D < 0) return false;
    const double vx_1 = 4*a*c / (2*a*(-b-sqrt(D)));
    if(vx_1 >= 0) {
        const double vx = sqrt(vx_1);
        const double vy = sqrt(V*V - vx_1);
        if(shoot(vx, vy, rects, X, Y)) return true;
    }
    const double vx_2 = (-b - sqrt(D)) / (2*a);
    if(vx_2 >= 0) {
        const double vx = sqrt(vx_2);
        const double vy = sqrt(V*V - vx_2);
        if(shoot(vx, vy, rects, X, Y)) return true;
    }
    return false;
}

bool solve() {
    int N, V, X, Y;
    if(!(cin >> N >> V >> X >> Y)) return false;

    vector<Rect> rects;
    for(int i = 0; i < N; ++i) {
        double l, b, r, t;
        cin >> l >> b >> r >> t;
        if(l > X) continue;
        if(r > X) r = X;
        rects.push_back(Rect(P(l, b), P(r, t)));
    }
    if(check(P(X, Y), rects, V, X, Y)) {
        cout << "Yes" << endl;
        return true;
    }

    for(const Rect &r : rects) {
        if(check(P(r.left(), r.top()), rects, V, X, Y)
            || check(r.rt, rects, V, X, Y))
        {
            cout << "Yes" << endl;
            return true;
        }
    }
    cout << "No" << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    while(solve()) ;
    return 0;
}

Compiler output:
a.cc: In function 'int cmp(double, double)':
a.cc:5:8: error: 'fabs' was not declared in this scope
    5 |     if(fabs(diff) < EPS) return 0;
      |        ^~~~
a.cc: At global scope:
a.cc:10:5: error: 'P' does not name a type
   10 |     P lb, rt;
      |     ^
a.cc:13:16: error: 'P' does not name a type
   13 |     Rect(const P &lb, const P &rt) : lb(lb), rt(rt) {}
      |                ^
a.cc:13:29: error: 'P' does not name a type
   13 |     Rect(const P &lb, const P &rt) : lb(lb), rt(rt) {}
      |                             ^
a.cc: In constructor 'Rect::Rect(const int&, const int&)':
a.cc:13:38: error: class 'Rect' does not have any field named 'lb'
   13 |     Rect(const P &lb, const P &rt) : lb(lb), rt(rt) {}
      |                                      ^~
a.cc:13:46: error: class 'Rect' does not have any field named 'rt'
   13 |     Rect(const P &lb, const P &rt) : lb(lb), rt(rt) {}
      |                                              ^~
a.cc: In member function 'double Rect::top() const':
a.cc:15:33: error: 'rt' was not declared in this scope
   15 |     double top() const { return rt.imag(); }
      |                                 ^~
a.cc: In member function 'double Rect::bottom() const':
a.cc:16:36: error: 'lb' was not declared in this scope
   16 |     double bottom() const { return lb.imag(); }
      |                                    ^~
a.cc: In member function 'double Rect::left() const':
a.cc:17:34: error: 'lb' was not declared in this scope
   17 |     double left() const { return lb.real(); }
      |                                  ^~
a.cc: In member function 'double Rect::right() const':
a.cc:18:35: error: 'rt' was not declared in this scope
   18 |     double right() const { return rt.real(); }
      |                                   ^~
a.cc: At global scope:
a.cc:25:40: error: 'vector' does not name a type
   25 | bool shoot(double vx, double vy, const vector<Rect> &rects, double X, double Y) {
      |                                        ^~~~~~
a.cc:25:46: error: expected ',' or '...' before '<' token
   25 | bool shoot(double vx, double vy, const vector<Rect> &rects, double X, double Y) {
      |                                              ^
a.cc: In function 'bool shoot(double, double, int)':
a.cc:27:20: error: 'Y' was not declared in this scope
   27 |         return cmp(Y, 0) == 0;
      |                    ^
a.cc:30:17: error: 'X' was not declared in this scope
   30 |     if(cmp(calc(X / vx, vy), Y) < 0) return false;
      |                 ^
a.cc:30:30: error: 'Y' was not declared in this scope
   30 |     if(cmp(calc(X / vx, vy), Y) < 0) return false;
      |                              ^
a.cc:35:25: error: 'rects' was not declared in this scope
   35 |     for(const Rect &r : rects) {
      |                         ^~~~~
a.cc: At global scope:
a.cc:60:18: error: 'P' does not name a type
   60 | bool check(const P &aim, const vector<Rect> &rects, double V, double X, double Y) {
      |                  ^
a.cc:60:32: error: 'vector' does not name a type
   60 | bool check(const P &aim, const vector<Rect> &rects, double V, double X, double Y) {
      |                                ^~~~~~
a.cc:60:38: error: expected ',' or '...' before '<' token
   60 | bool check(const P &aim, const vector<Rect> &rects, double V, double X, double Y) {
      |                                      ^
a.cc: In function 'bool check(const int&, int)':
a.cc:61:22: error: 'norm' was not declared in this scope
   61 |     const double a = norm(aim);
      |                      ^~~~
a.cc:62:30: error: request for member 'imag' in 'aim', which is of non-class type 'const int'
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                              ^~~~
a.cc:62:41: error: request for member 'real' in 'aim', which is of non-class type 'const int'
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                                         ^~~~
a.cc:62:52: error: request for member 'real' in 'aim', which is of non-class type 'const int'
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                                                    ^~~~
a.cc:62:61: error: 'V' was not declared in this scope
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                                                             ^
a.cc:62:69: error: request for member 'real' in 'aim', which is of non-class type 'const int'
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                                                                     ^~~~
a.cc:62:80: error: request for member 'real' in 'aim', which is of non-class type 'const int'
   62 |     const double b = 9.8*aim.imag()*aim.real()*aim.real() - V*V*aim.real()*aim.real();
      |                                                                                ^~~~
a.cc:63:38: error: request for member 'real' in 'aim', which is of non-class type 'const int'
   63 |     const double c = 4.9*4.9*pow(aim.real(), 4);
      |                                      ^~~~
a.cc:63:30: error: 'pow' was not declared in this scope
   63 |     const double c = 4.9*4.9*pow(aim.real(), 4);
      |                              ^~~
a.cc:67:42: error: 'sqrt' was not declared in this scope
   67 |     const double vx_1 = 4*a*c / (2*a*(-b-sqrt(D)));
      |                                          ^~~~
a.cc:71:26: error: 'rects' was not declared in this scope
   71 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                          ^~~~~
a.cc:71:33: error: 'X' was not declared in this scope
   71 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                                 ^
a.cc:71:36: error: 'Y' was not declared in this scope
   71 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                                    ^
a.cc:77:26: error: 'rects' was not declared in this scope
   77 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                          ^~~~~
a.cc:77:33: error: 'X' was not declared in this scope
   77 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                                 ^
a.cc:77:36: error: 'Y' was not declared in this scope
   77 |         if(shoot(vx, vy, rects, X, Y)) return true;
      |                                    ^
a.cc: In function 'bool solve()':
a.cc:84:10: error: 'cin' was not declared in this scope
   84 |     if(!(cin >> N >> V >> X >> Y)) return false;
      |          ^~~
a.cc:86:5: error: 'vector' was not declared in this scope
   86 |     vector<Rect> rects;
      |     ^~~~~~
a.cc:86:16: error: expected primary-expression before '>' token
   86 |     vector<Rect> rects;
      |                ^
a.cc:86:18: error: 'rects' was not declared in this scope
   86 |     vector<Rect> rects;
      |                  ^~~~~
a.cc:89:9: error: 'cin' was not declared in this scope
   89 |         cin >> l >> b >> r >> t;
      |         ^~~
a.cc:92:30: error: 'P' was not declared in this scope
   92 |         rects.push_back(Rect(P(l, b), P(r, t)));
      |                              ^
a.cc:94:14: error: 'P' was not declared in this scope
   94 |     if(check(P(X, Y), rects, V, X, Y)) {
      |              ^
a.cc:95:9: error: 'cout' was not declared in this scope
   95 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:95:26: error: 'endl' was not declared in this scope
   95 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:100:18: error: 'P' was not declared in this scope
  100 |         if(check(P(r.left(), r.top()), rects, V, X, Y)
      |                  ^
a.cc:101:24: error: 'const struct Rect' has no member named 'rt'
  101 |             || check(r.rt, rects, V, X, Y))
      |                        ^~
a.cc:103:13: error: 'cout' was not declared in this scope
  103 |             cout << "Yes" << endl;
      |             ^~~~
a.cc:103:30: error: 'endl' was not declared in this scope
  103 |             cout << "Yes" << endl;
      |                              ^~~~
a.cc:107:5: error: 'cout' was not declared in this scope
  107 |     cout << "No" << endl;
      |     ^~~~
a.cc:107:21: error: 'endl' was not declared in this scope
  107 |     cout << "No" << endl;
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:112:5: error: 'cin' was not declared in this scope
  112 |     cin.tie(0);
      |     ^~~
a.cc:113:5: error: 'ios' has not been declared
  113 |     ios::sync_with_stdio(0);
      |     ^~~