Cuprate superconductivity: Dependence of Tc on the c-axis layering structure