Optimal Resource Provisioning Algorithm for Greener Future