System-wide energy minimization for real-time tasks: lower bound and approximation