Suppose we have $n$ carnot engines connected together labelled as $C_1,C_2...C_n$, now suppose we feed an energy of $E_1$ into $C_1$, now by the second law of thermodynamics, it must be that efficiency can't be $1$ , so some heat is dumped to environment, let's say we 'direct' the heat dump $E_2$ into $C_2$, and we keep doing this procedure till we reach the $n-1th$ engine. Now, the heat dump of this engine into n+1th engine must be very small in magnitude ( say we have enough engines such that this happens), then this if we look at the at the total efficiency of the process:
$$ e= \frac{Q_{in-sys} - Q_{out-sys} }{Q_{in-sys} }$$
The question I have is how to achieve the step where we direct the heat loss from the $ith$ engine to the $i+1th$ engine. If there was a way to do that I Think this would be a viable method for maximizing heat engnine output.