Cost-aware Simulation-based Inference