Extending the polarizable continuum model to effective ab initio pair potentials in multicomponent solutions: A test on calcium-water and calcium-ammonia potentials