2010 AIME II Problem 11

Define a T-grid to be a 3 \times 3 matrix which satisfies the following two properties:

  • (1) Exactly five of the entries are \text { 1's, }, and the remaining four entries are \text { 0's, },
  • (2) Among the eight rows, columns, and long diagonals (the long diagonals are \left\{a_{13}, a_{22}, a_{31}\right\} and \left.\left\{a_{11}, a_{22}, a_{33}\right\}\right), no more than one of the eight has all three entries equal.

Find the number of distinct T-grids.