Here is the question:

a, b and c are 3 different, positive integers, and (ab)^2 = abc.

Which of the following is a possible value for c?

1

5

9

12

I know the answer is 12, but i do not understand how to get this, aside from guess and check.

Any help would be appreciated.