1. Abridged Problem Statement
You are given integers a, b, c and two intervals [x1, x2], [y1, y2]. Count the number of integer pairs (x, y) satisfying
  a·x + b·y + c = 0
and
  x1 ≤ x ≤ x2, y1 ≤ y ≤ y2.

2. Detailed Editorial
We want all integer solutions to a·x + b·y = –c that lie in the rectangle [x1, x2]×[y1, y2].

Step A. Handle the fully-degenerate case:
- If a = 0 and b = 0, the equation reduces to c = 0.
  • If c = 0, every (x,y) in the rectangle is a solution, so answer = (x2−x1+1)·(y2−y1+1).
  • Otherwise, no solutions.

Step B. General case (not both coefficients zero).
1. Compute g = gcd(a, b) and find one particular solution (x0, y0) to a·x + b·y = –c via the extended Euclidean algorithm. If g does not divide –c, there are no integer solutions.
2. All solutions are given by
  x = x0 + (b/g)·t,
  y = y0 − (a/g)·t,
   where t is any integer.
3. Impose the interval constraints on x and y to get inequalities on t:
  x1 ≤ x0 + (b/g)·t ≤ x2
  y1 ≤ y0 − (a/g)·t ≤ y2
   Solve each for t to get two integer intervals of t values.
4. The intersection of these t-intervals gives all valid t values; its size (if positive) is the answer.

This parametric range computation also covers the cases where exactly one of a, b is zero: that simply makes one of the two step sizes equal to its corresponding nonzero divisor while the other variable is pinned, and the per-variable interval routine still returns the correct bounds on t.

Edge considerations: converting the two inequalities to bounds on t requires careful handling of the sign of the step size b/g or –a/g. The helper routines `first_in_range_k` and `last_in_range_k` compute, for a given base value and signed step, the smallest and largest multiples k that keep the value inside the target interval, for both positive and negative steps.

Complexity is dominated by extended gcd, which is O(log max(|a|,|b|)), easily within limits; all arithmetic uses 64-bit integers.

3. C++ Solution
```cpp
#include <bits/stdc++.h>

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;
};

int64_t extend_gcd(int64_t a, int64_t b, int64_t &x, int64_t &y) {
    if(b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int64_t x1, y1;
    int64_t d = extend_gcd(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}

int64_t a, b, c;
pair<int64_t, int64_t> range_x, range_y;

void read() {
    cin >> a >> b >> c;
    cin >> range_x >> range_y;
}

int64_t first_in_range_k(
    pair<int64_t, int64_t> range, int64_t x, int64_t delta
) {
    if(delta > 0) {
        if(x < range.first) {
            int64_t k = (range.first - x + delta - 1) / delta;
            return k;
        } else {
            int64_t k = (x - range.first) / delta;
            return -k;
        }
    } else {
        if(x >= range.first) {
            int64_t k = (x - range.first) / (-delta);
            return k;
        } else {
            int64_t k = (range.first - x - delta - 1) / (-delta);
            return -k;
        }
    }
}

int64_t last_in_range_k(
    pair<int64_t, int64_t> range, int64_t x, int64_t delta
) {
    if(delta > 0) {
        if(x > range.second) {
            int64_t k = (x - range.second + delta - 1) / delta;
            return -k;
        } else {
            int64_t k = (range.second - x) / delta;
            return k;
        }
    } else {
        if(x <= range.second) {
            int64_t k = (range.second - x) / (-delta);
            return -k;
        } else {
            int64_t k = (x - range.second - delta - 1) / (-delta);
            return k;
        }
    }
}

bool not_in_range(int64_t x, pair<int64_t, int64_t> range) {
    return x < range.first || x > range.second;
}

void solve() {
    c *= -1;

    if(b < 0) {
        a *= -1;
        b *= -1;
        c *= -1;
    }

    if(a == 0 && b == 0) {
        if(c == 0) {
            cout << (range_x.second - range_x.first + 1) * 1ll *
                        (range_y.second - range_y.first + 1)
                 << '\n';
        } else {
            cout << 0 << '\n';
        }
        return;
    }

    int64_t x, y;
    // a x + b y = g
    int64_t g = extend_gcd(a, b, x, y);

    if(c % g) {
        cout << 0 << '\n';
        return;
    }

    x *= c / g;
    y *= c / g;

    int64_t delta_x = b / g;
    int64_t delta_y = -a / g;

    int64_t lxk = first_in_range_k(range_x, x, delta_x),
            rxk = last_in_range_k(range_x, x, delta_x);
    int64_t lyk = first_in_range_k(range_y, y, delta_y),
            ryk = last_in_range_k(range_y, y, delta_y);

    if(not_in_range(x + lxk * delta_x, range_x) ||
       not_in_range(y + lyk * delta_y, range_y) ||
       not_in_range(x + rxk * delta_x, range_x) ||
       not_in_range(y + ryk * delta_y, range_y)) {
        cout << 0 << '\n';
        return;
    }

    if(lxk > rxk) {
        swap(lxk, rxk);
    }
    if(lyk > ryk) {
        swap(lyk, ryk);
    }

    int64_t ans = max(0ll, min(rxk, ryk) - max(lxk, lyk) + 1);
    cout << ans << '\n';
}

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
```python
import sys
sys.setrecursionlimit(10**7)

# Extended GCD: returns (g, x, y) with a*x + b*y = g
def ext_gcd(a, b):
    if b == 0:
        return (a, 1, 0)
    g, x1, y1 = ext_gcd(b, a % b)
    # back-substitute
    x = y1
    y = x1 - (a // b) * y1
    return (g, x, y)

# Given range [l, r], base value x, and step delta,
# find smallest integer k with x + k*delta >= l
def first_k(l, x, delta):
    if delta > 0:
        if x < l:
            return (l - x + delta - 1) // delta
        else:
            return -((x - l) // delta)
    else:
        # delta < 0
        if x >= l:
            return (x - l) // (-delta)
        else:
            return -((l - x + (-delta) - 1) // (-delta))

# Find largest integer k with x + k*delta <= r
def last_k(r, x, delta):
    if delta > 0:
        if x > r:
            return -((x - r + delta - 1) // delta)
        else:
            return (r - x) // delta
    else:
        if x <= r:
            return -((r - x) // (-delta))
        else:
            return (x - r + (-delta) - 1) // (-delta)

# Read input
a, b, c, x1, x2, y1, y2 = map(int, sys.stdin.read().split())
# c on LHS, so move to RHS
c = -c

# Case a=b=0
if a == 0 and b == 0:
    if c == 0:
        print((x2 - x1 + 1) * (y2 - y1 + 1))
    else:
        print(0)
    sys.exit(0)

# Handle sign so b>=0
if b < 0:
    a, b, c = -a, -b, -c

# Use ext_gcd to solve a*x + b*y = g
g, x0, y0 = ext_gcd(abs(a), abs(b))
# adjust signs if a or b were negative
if a < 0: x0 = -x0
if b < 0: y0 = -y0

# No solution if c not divisible by g
if c % g != 0:
    print(0)
    sys.exit(0)

# Scale base solution to match exactly a*x + b*y = c
x0 *= c // g
y0 *= c // g

# General solution: x = x0 + (b/g)*t, y = y0 - (a/g)*t
dx = b // g
dy = -a // g

# Compute t-ranges for x and y bounds
lx = first_k(x1, x0, dx)
rx = last_k(x2, x0, dx)
ly = first_k(y1, y0, dy)
ry = last_k(y2, y0, dy)

# Ensure the endpoints actually lie in the rectangle
def in_range(v, low, high):
    return low <= v <= high

# If extremes fall outside, zero solutions
if not in_range(x0 + lx*dx, x1, x2) or not in_range(x0 + rx*dx, x1, x2) \
   or not in_range(y0 + ly*dy, y1, y2) or not in_range(y0 + ry*dy, y1, y2):
    print(0)
    sys.exit(0)

# Normalize
if lx > rx: lx, rx = rx, lx
if ly > ry: ly, ry = ry, ly

# Intersection of [lx, rx] and [ly, ry]
lo = max(lx, ly)
hi = min(rx, ry)
print(max(0, hi - lo + 1))
```

5. Compressed Editorial
Use extended GCD to find a particular integer solution to a·x + b·y = –c. All solutions form a one-parameter family x = x0 + (b/g)t, y = y0 − (a/g)t. Convert the box constraints into two intervals for t, intersect them, and the intersection length is the answer. Handle the a=b=0 case separately (the single-zero cases fall out of the general parametric routine) and use 64-bit arithmetic to avoid overflow.
