  We want to understand whether and to which extent the maximal (Carnot)
efficiency for heat engines can be reached at a finite power. To this end we
generalize the Carnot cycle so that it is not restricted to slow processes. We
show that for realistic (i.e. not purposefully-designed) engine-bath
interactions, the work-optimal engine performing the generalized cycle close to
the maximal efficiency has a long cycle time and hence vanishing power. This
aspect is shown to relate to the theory of computational complexity. A physical
manifestation of the same effect is the Levinthal's paradox in the protein
folding problem. The resolution of this paradox for realistic proteins allows
to construct engines that can extract at a finite power 40% of the maximally
possible work reaching 90% of the maximal efficiency. For purposefully designed
engine-bath interactions, the Carnot efficiency is achievable at a large power.
