1. Abridged Problem Statement  
Given N fuel types, each with density aᵢ, cost bᵢ, intensity cᵢ, you may buy any nonnegative real mass mᵢ of each type so that total volume ∑(aᵢ·mᵢ)≤A and total cost ∑(bᵢ·mᵢ)≤B. Find the maximum total intensity ∑(cᵢ·mᵢ).

2. Detailed Editorial  
We must solve a two-constraint linear program in continuous variables mᵢ≥0:
 maximize ∑cᵢmᵢ  
 subject to ∑aᵢmᵢ≤A,  ∑bᵢmᵢ≤B.  
Because the objective and constraints are linear, the optimum lies either at a single fuel type or at a mixture of two fuels.  

Reparameterize by total intensity M=∑cᵢmᵢ, and let xᵢ be the fraction of intensity from fuel i: xᵢ = (cᵢmᵢ)/M, so ∑xᵢ=1, xᵢ≥0. Then mᵢ = M·xᵢ/cᵢ, and the constraints become:  
 M·∑(aᵢ·xᵢ/cᵢ) ≤ A  ⇒  ∑(aᵢ/cᵢ)·xᵢ ≤ A/M  
 M·∑(bᵢ·xᵢ/cᵢ) ≤ B  ⇒  ∑(bᵢ/cᵢ)·xᵢ ≤ B/M  

Define point pᵢ = (Xᵢ, Yᵢ) = (aᵢ/cᵢ, bᵢ/cᵢ) in the plane. Any convex combination ∑xᵢpᵢ is also feasible as a weighted average. Let P = ∑xᵢpᵢ = (X, Y). The constraints read X ≤ A/M and Y ≤ B/M, so M ≤ min(A/X, B/Y). To maximize M we must minimize max(X/A, Y/B). Geometrically that is the smallest t such that (t·A, t·B) lies in the convex hull of the points {pᵢ}. Equivalently, scale the target point T=(A,B) by the factor t so that the ray from the origin through T first hits the convex hull. That intersection point Q yields t = Q·x/A = Q·y/B, and the maximum intensity is M = 1/t = min(A/Q·x, B/Q·y).

Algorithm steps:  
1. Compute for each fuel pᵢ=(aᵢ/cᵢ, bᵢ/cᵢ) and track the best single-fuel answer Mᵢ = min(A/Xᵢ, B/Yᵢ).  
2. Build the convex hull of all pᵢ (excluding duplicates) in O(N log N).  
3. Walk through hull edges; for each edge between p₁ and p₂, compute intersection of line O→T with the line p₁→p₂. If the intersection lies on the segment, update M = max(M, min(A/X_int, B/Y_int)).  
4. Print M.

This runs in O(N log N) and handles up to N=75 000.

3. C++ Solution
```cpp
#include <bits/stdc++.h>
// #include <coding_library/geometry/geometry2d.hpp>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

using coord_t = long double;

struct Point {
    static constexpr coord_t eps = 1e-9;

    coord_t x, y;
    Point(coord_t x = 0, coord_t y = 0) : x(x), y(y) {}

    Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); }
    Point operator-(const Point& p) const { return Point(x - p.x, y - p.y); }
    Point operator*(coord_t c) const { return Point(x * c, y * c); }
    Point operator/(coord_t c) const { return Point(x / c, y / c); }

    coord_t operator*(const Point& p) const { return x * p.x + y * p.y; }
    coord_t operator^(const Point& p) const { return x * p.y - y * p.x; }

    bool operator==(const Point& p) const { return x == p.x && y == p.y; }
    bool operator!=(const Point& p) const { return x != p.x || y != p.y; }
    bool operator<(const Point& p) const {
        return x != p.x ? x < p.x : y < p.y;
    }
    bool operator>(const Point& p) const {
        return x != p.x ? x > p.x : y > p.y;
    }
    bool operator<=(const Point& p) const {
        return x != p.x ? x < p.x : y <= p.y;
    }
    bool operator>=(const Point& p) const {
        return x != p.x ? x > p.x : y >= p.y;
    }

    coord_t norm2() const { return x * x + y * y; }
    double norm() const { return sqrt(norm2()); }
    double angle() const { return atan2(y, x); }

    Point rotate(double a) const {
        return Point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
    }

    Point perp() const { return Point(-y, x); }
    Point unit() const { return *this / norm(); }
    Point normal() const { return perp().unit(); }
    Point project(const Point& p) const {
        return *this * (*this * p) / norm2();
    }
    Point reflect(const Point& p) const {
        return *this * 2 * (*this * p) / norm2() - p;
    }

    friend ostream& operator<<(ostream& os, const Point& p) {
        return os << p.x << ' ' << p.y;
    }
    friend istream& operator>>(istream& is, Point& p) {
        return is >> p.x >> p.y;
    }

    friend int ccw(const Point& a, const Point& b, const Point& c) {
        coord_t v = (b - a) ^ (c - a);
        if(-eps <= v && v <= eps) {
            return 0;
        } else if(v > 0) {
            return 1;
        } else {
            return -1;
        }
    }

    friend bool point_on_segment(
        const Point& a, const Point& b, const Point& p
    ) {
        return ccw(a, b, p) == 0 && p.x >= min(a.x, b.x) - eps &&
               p.x <= max(a.x, b.x) + eps && p.y >= min(a.y, b.y) - eps &&
               p.y <= max(a.y, b.y) + eps;
    }

    friend bool point_in_triangle(
        const Point& a, const Point& b, const Point& c, const Point& p
    ) {
        int d1 = ccw(a, b, p);
        int d2 = ccw(b, c, p);
        int d3 = ccw(c, a, p);
        return (d1 >= 0 && d2 >= 0 && d3 >= 0) ||
               (d1 <= 0 && d2 <= 0 && d3 <= 0);
    }

    friend Point line_line_intersection(
        const Point& a1, const Point& b1, const Point& a2, const Point& b2
    ) {
        return a1 +
               (b1 - a1) * ((a2 - a1) ^ (b2 - a2)) / ((b1 - a1) ^ (b2 - a2));
    }
};

class Polygon {
  public:
    vector<Point> points;

    Polygon() {}
    Polygon(const vector<Point>& points) : points(points) {}

    int size() const { return points.size(); }

    coord_t area() const {
        coord_t a = 0;
        for(int i = 0; i < size(); i++) {
            a += points[i] ^ points[(i + 1) % size()];
        }
        return a / 2.0;
    }
};

class ConvexHull : public Polygon {
  public:
    int upper_hull_size;

    ConvexHull(const vector<Point>& points) {
        this->points = points;
        sort(this->points.begin(), this->points.end());
        this->points.erase(
            unique(this->points.begin(), this->points.end()), this->points.end()
        );

        if(this->points.size() <= 2) {
            this->upper_hull_size = this->points.size();
            return;
        }

        vector<int> hull = {0};
        vector<bool> used(this->points.size());

        function<void(int, int)> expand_hull = [&](int i, int min_hull_size) {
            while((int)hull.size() >= min_hull_size &&
                  ccw(this->points[hull[hull.size() - 2]],
                      this->points[hull.back()], this->points[i]) >= 0) {
                used[hull.back()] = false;
                hull.pop_back();
            }
            hull.push_back(i);
            used[i] = true;
        };

        for(int i = 1; i < (int)this->points.size(); i++) {
            expand_hull(i, 2);
        }

        upper_hull_size = hull.size();
        for(int i = (int)this->points.size() - 2; i >= 0; i--) {
            if(!used[i]) {
                expand_hull(i, upper_hull_size + 1);
            }
        }

        hull.pop_back();

        vector<Point> points_in_hull;
        for(int i: hull) {
            points_in_hull.push_back(this->points[i]);
        }
        this->points = std::move(points_in_hull);
    }
};

int n;
coord_t A, B;
vector<tuple<int, int, int>> fuels;

void read() {
    cin >> n >> A >> B;
    fuels.resize(n);
    for(auto& [x, y, z]: fuels) {
        cin >> x >> y >> z;
    }
}

void solve() {
    // Each fuel kind i is a point p_i = (a_i/c_i, b_i/c_i): per unit of
    // intensity it uses p_i.x of volume and p_i.y of dollars. A mixture is a
    // convex combination of these points scaled by the total intensity t, so
    // the resource cost per unit intensity ranges over the convex hull of the
    // points. For a hull point p the largest feasible intensity is
    // min(A / p.x, B / p.y).
    //
    // - The optimum over the whole feasible region is attained either at an
    //   original vertex or where the ray from the origin through (A, B) crosses
    //   a hull edge, since that direction balances the two constraints.
    //
    // - So we build the convex hull of the points, evaluate min(A/x, B/y) at
    //   every vertex, and also at the intersection of segment origin-(A,B) with
    //   each hull edge, taking the maximum.

    coord_t ans = 0.0;
    vector<Point> points;
    for(int i = 0; i < n; i++) {
        points.push_back(Point(
            get<0>(fuels[i]) / (coord_t)get<2>(fuels[i]),
            get<1>(fuels[i]) / (coord_t)get<2>(fuels[i])
        ));
        ans = max(ans, min(A / points[i].x, B / points[i].y));
    }

    ConvexHull hull(points);

    Point origin(0, 0), target_loc(A, B);
    for(int i = 0; i < (int)hull.points.size(); i++) {
        Point p1 = hull.points[i];
        Point p2 = hull.points[(i + 1) % hull.points.size()];

        if(fabs((target_loc - origin) ^ (p1 - p2)) > Point::eps) {
            Point intersection =
                line_line_intersection(origin, target_loc, p1, p2);
            if(point_on_segment(p1, p2, intersection)) {
                ans = max(ans, min(A / intersection.x, B / intersection.y));
            }
        }
    }

    cout << setprecision(6) << fixed << ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}
```

4. Python Solution with Detailed Comments  
```python
import sys
import threading

def main():
    import math
    data = sys.stdin.read().split()
    it = iter(data)
    N = int(next(it))
    A = float(next(it))
    B = float(next(it))
    pts = []
    ans = 0.0

    # Read fuels, convert to (a/c, b/c), track single-fuel best
    for _ in range(N):
        a = float(next(it)); b = float(next(it)); c = float(next(it))
        x = a / c
        y = b / c
        pts.append((x,y))
        # pure fuel intensity = min(A/x, B/y)
        M = min(A/x, B/y)
        if M > ans: ans = M

    # Convex hull via monotone chain
    pts = sorted(set(pts))
    if len(pts) > 1:
        def cross(o, a, b):
            return (a[0]-o[0])*(b[1]-o[1]) - (a[1]-o[1])*(b[0]-o[0])
        lower = []
        for p in pts:
            while len(lower)>=2 and cross(lower[-2], lower[-1], p) <= 0:
                lower.pop()
            lower.append(p)
        upper = []
        for p in reversed(pts):
            while len(upper)>=2 and cross(upper[-2], upper[-1], p) <= 0:
                upper.pop()
            upper.append(p)
        hull = lower[:-1] + upper[:-1]
    else:
        hull = pts

    # Ray from origin through T = (A,B)
    # For each hull edge, find intersection with this ray
    def intersect(o, t, p, q):
        # Solve o + α*(t-o) = p + β*(q-p)
        # Use cross products to find α
        otx, oty = t[0]-o[0], t[1]-o[1]
        pqx, pqy = q[0]-p[0], q[1]-p[1]
        num = ((p[0]-o[0])*pqy - (p[1]-o[1])*pqx)
        den = (otx*pqy - oty*pqx)
        if abs(den) < 1e-12:
            return None
        alpha = num/den
        return (o[0] + alpha*otx, o[1] + alpha*oty)

    def on_seg(p, q, r):
        # Is r on segment p->q?
        return (min(p[0],q[0]) - 1e-9 <= r[0] <= max(p[0],q[0]) + 1e-9
                and min(p[1],q[1]) - 1e-9 <= r[1] <= max(p[1],q[1]) + 1e-9)

    O = (0.0,0.0)
    T = (A,B)
    Hn = len(hull)
    for i in range(Hn):
        p1 = hull[i]
        p2 = hull[(i+1)%Hn]
        # skip parallel
        if abs((T[0]-O[0])*(p1[1]-p2[1]) - (T[1]-O[1])*(p1[0]-p2[0])) < 1e-12:
            continue
        I = intersect(O, T, p1, p2)
        if I and on_seg(p1, p2, I):
            M = min(A/I[0], B/I[1])
            if M > ans:
                ans = M

    print(f"{ans:.6f}")

if __name__ == "__main__":
    threading.Thread(target=main).start()
```

5. Compressed Editorial  
- Reformulate LP in intensity space: mᵢ = M·xᵢ/cᵢ, ∑xᵢ=1.  
- Constraints ⇒ ∑(aᵢ/cᵢ)xᵢ ≤ A/M, ∑(bᵢ/cᵢ)xᵢ ≤ B/M.  
- Points pᵢ=(aᵢ/cᵢ,bᵢ/cᵢ). Need minimal t with (tA,tB) in conv{pᵢ}.  
- Build convex hull of pᵢ, intersect ray O→(A,B) with hull edges, derive M=min(A/x_int,B/y_int).  
- Compare with single-fuel cases and output the maximum.