Self-similar optical pulses in competing cubic-quintic nonlinear media with distributed coefficients