Consider the following problem: you are given two BODIES at temp TA and TB.Do you agree that the maximum possible work i can extract from them happens to be in the case when they are left with the equilibrium final temperature of sqrt(TA.TB). This minimizes the entropy and hence corresponds to the maximum possible work extractable from the system.this is consequently the minimum possible equilibrium temperature. now, we im interested in the case of how its possible to attain maximum possible equilibrium temperature and what is its value? I think it would be when the bodies are placed next to each other such that the final temperature is (TA+TB)/2. In this case the useful work done would be zero, being entirely wasted to increase entropy. do you agree?