Triangles in the Grid |
There is a grid of n*m unit squares, which has n + 1 horizontal lines, m + 1 vertical lines and (n + 1)(m + 1) intersection vertices. You can choose three distinct non-collinear vertices to form a triangle. For example, if n = m = 1, there are 4 vertices, which can form 4 triangles.
How many of these triangles have area between A and B (inclusive)?
4 1 1 0 1 1 2 1 2 10 10 20 30 12 34 56 78
4 6 27492 1737488