2017 AIME II Problem 14

A 10 \times 10 \times 10 grid of points consists of all points in space of the form (i, j, k), where i, j, and k are integers between 1 and 10 , inclusive. Find the number of different lines that contain exactly 8 of these points.