A class of constrained inverse eigenproblem and associated approximation problem for skew symmetric and centrosymmetric matrices