Here we have confusion that when to use given two formula
(1) T$_{avg}$ = (hit ratio) * (Cache access time) + (1- h) (Cache access time + Memory access time)
(2) T$_{avg}$ = (hit ratio) * (Cache access time) + (1- h) (Cache miss penalty)
see, when in the question memory access time given explicitly and there is no discussion of cache miss penalty then we will for 1st formula.
and if in the question cache miss penalty is given and no memory access time then use 2nd formula.
now coming to the question, here cache miss penalty is not given rather memory access time is given after cache miss.
so we will use this formula:
(1) T$_{avg}$ = (hit ratio) * (Cache access time) + (1- h) (Cache access time + Memory access time)
= $\frac{80}{100} (3) + (1 - \frac{80}{100}) (3 + 30)$
= $\frac{240}{100} + \frac{660}{100}$
= $\frac{900}{100}$
= 9 ns.
Answer : 9 ns.