Spin-restricted density functional approach to the open-shell problem