Construction of grating profiles yielding prescribed diffraction efficiencies