Optimal design of an elastic beam with a unilateral elastic foundation: Semicoercive state problem