Btw, the problem was solved by 61 people so far.<p>Random thoughts:<p>I think the mod is just there to distract or for hinting that you shouldn't come up with a brute force method.<p>Observations:<p>1. Assume an infinite grid. Add 3 random points _not_ on a line. Clearly, they'll be a convex set (a triangle).<p>2. Add a 4th point such that it is not on an existing line.<p>You've now a quadrilateral.<p>So for the case of Q(2,2) = 94 = choose(9,4) - 32. 32 is the number of points that would make 3 of the 4 points lie on a line.<p>Come up with a recurrence relations and solve it.