From Function to Distribution Modeling: A PAC-Generative Approach to Offline Optimization