Standard deviation of the portfolio = (Bh X C X By)

Above formula is given in the reference topic, however inputs are the same as a normal calculation for standard deviation using weights.

I am not able understand, how to identify which formula to use - I mean in exam, when we see inputs for standard deviation calculation, we will tend to use the formula with weights.

Any solution/thoughts?