By definition,
where where Q is the useful heat supplied or removed by the considered system and W is the work required by the considered system.
For Carnot cycle or Carnot engine,
is the absolute temperature of the cold reservoir, and is the absolute temperature of the hot reservoir.