Optimal configuration of a class of irreversible heat engines. I | Synapse