When counting, remember that some squares are split into pieces. As well, the four vertices of \(\mathbb{T}\) count together as one intersection point.
Relate the number of segments to the number of unit lattice squares through which \(L_{q,p}\) passes.
Such a line has an equation of the form \(y=\dfrac{p}{q}x+b\). What can you say about \(f(0)\) and \(f(1)\) based on the fact that the line intersects \(T\)? do not forget about the condition that the line must pass through at least one lattice point!
Each square has a leftmost vertex.
Similar to the hint for part (c), such a line must have equation \(y=-\dfrac{q}{p}x+b\). Try to deduce restrictions on the value of \(b\) from the fact that this line intersects \(L_{q,p}\).
Since the squares have the same size (though some might be broken into pieces) and \(\mathbb{T}\) has area \(1\), the area of the squares can be computed by computing the number of them. Our solution will put together the ideas from (b) through (e) to count the squares. Specifically, the count in part (e) can be related to the number of squares. Remember to be careful with the four corners of \(\mathbb{T}\), which count as one point.