(d)
Total number of points in a plane is $3p$
$\therefore$ Maximum number of triangles
$= \ ^{3p}C_{3} - 3.\ ^{p}C_{3}$
[here, we subtract those triangles which points are in a line]
$= \frac{(3p)!}{(3p - 3)!3!} - 3.\frac{p!}{(p - 3)3!}$
$= \frac{3p(3p - 1)(3p - 2)}{3 \times 2} - \frac{3 \times p(p - 1)(p - 2)}{3 \times 2}$
$= \frac{p}{2}\left\lbrack 9p^{2} - 9p + 2 - \left( p^{2} - 3p + 2 \right) \right\rbrack = p^{2}(4p - 3)$