Ferromagnet-antiferromagnet transition in layered perovskites of Sr3YCo4O10.5 type