Study of the level structures of near closed shell nuclei and K X-ray yields in deformed even-even rare earths