Optimal charge inhomogeneity for the
d
+i
d
-wave superconductivity in the intercalated graphite CaC
6