A Dynamic Programming Algorithm for Energy-aware Routing of Delivery Drones