Energy levels and transition probabilities from the Rayleigh-Ritz variation method: C I and O III