12. (18 points) A school's mathematics interest group consists of $m$ students, and the school has arranged $n$ instructors to guide them. During one of the group's activities, each pair of students asks each other one question, each student asks each instructor one question, and each instructor asks the entire group one question. It is known that a total of 51 questions were asked, and all questions are distinct. Try to find the values of $m$ and $n$.