There are total m instructions to be executed.
from m instructions , if branch taken mp , if no branch is taken then number of instructions m(1-p)
see below diagram
instructions mpq take n clock cyles for each instruction to execute so total number of clock cycles = mpqn
instructions mp(1-q) take 1 clock cyles per 1 ns so total clock cycle is mp(1-q)
And m(1-p) take 1 clock cycles in each ns so total clock cycle is m(1-p)
Now , CPI = {mpqn + mp(1-q) + m(1-p)} / m
= (mpqn + mp - mpq + m - mp ) / m
= (mpqn - mpq + m ) / m
= mpq( n-1) + m / m
= m {pq(n-1) + 1 } / m
= pqn - pq + 1
= 1 + pq ( n -1)
which is option C