8. Given positive integers $a, b$ satisfying $a<b<2a$. A rectangle on the coordinate plane with vertices at integer points and sides parallel to the coordinate axes is called a "standard rectangle". A standard rectangle with an area of 1 is called a "square". Some squares on the coordinate plane are colored red. It is known that any $a \times b$ and $b \times a$ standard rectangles contain at least one red square. Find the maximum constant $\alpha$ such that for any positive integer $N$, there exists an $N \times N$ standard rectangle containing at least $\alpha N^{2}$ red squares.
8. $\alpha_{\max }=\frac{1}{2 a^{2}-2 a b+b^{2}}$.
(1) First, construct an example where $\alpha \leqslant \frac{1}{D}$, where
$$
D=a^{2}+(b-a)^{2}=2 a^{2}-2 a b+b^{2} \text {. }
$$

Arbitrarily color one grid red, then translate it by $n \boldsymbol{\beta}+m \boldsymbol{\gamma}(m, n \in \mathbf{Z}, \boldsymbol{\beta}=(a, b-a)$, $\gamma=(b-a,-a))$ to obtain all red grids.

Thus, each $D \times D$ standard rectangle contains exactly $D$ red grids.

Next, prove that each $a \times b$ and $b \times a$ standard rectangle contains at least one red grid.

It suffices to prove that each $a \times b$ standard rectangle contains a red grid. The proof for $b \times a$ standard rectangles is similar.
Let $K$ be any $a \times b$ standard rectangle.
Consider the horizontal strip of width $b$ containing this standard rectangle, which clearly contains a red grid.

Let the center coordinates of this red grid be $(x, y)$. Then $(x+a, y+(b-a))$ and $(x+(b-a), y-a)$ are also centers of red grids, one of which is located within the strip.

Similarly, $(x-a, y-(b-a))$ and $(x-(b-a), y+a)$ are also centers of red grids, one of which is located within the strip.

This shows that in the horizontal direction, each interval of length $a$ within the strip must contain a point of a red grid. In particular, rectangle $K$ contains a red grid.
From the above discussion, we have $\alpha \leqslant \frac{D}{D^{2}}=\frac{1}{D}$.
(2) For $\alpha=\frac{1}{D}$, the conclusion of the problem holds.
In fact, each $a \times b$ standard rectangle of width $a$ and height $b$ corresponds to the red grid with the highest y-coordinate it contains (if there are multiple such red grids, then it corresponds to the leftmost one among them).

Next, prove that at most $D$ $a \times b$ standard rectangles correspond to the same red grid.
Assume without loss of generality that the center coordinates of the red grid $A$ are $\left(\frac{1}{2}, \frac{1}{2}\right)$.
Consider the horizontal strip
$$
\Gamma=\{(x, y) \mid-\infty\frac{m(m-a-b)}{D}=\frac{(a+b)^{2} N^{2}\left(N^{2}-1\right)}{D} .
\end{array}
$$

Divide the standard rectangle $T$ into the union of $(a+b)^{2} N^{2}$ $N \times N$ standard rectangles. Then one of them contains more than $\frac{N^{2}-1}{D}$ red grids. This indicates that the number of red grids in it is at least
$$
\frac{N^{2}-1}{D}+\frac{1}{D}=\frac{N^{2}}{D} .
$$