On the criteria of formation and lattice distortion of perovskite-type complex halides