Efficient Green Solution for a Balanced Energy Consumption and Delay in the IoT-Fog-Cloud Computing