Type: Binary search or greedy.
Notes:
1. In order to get an answer X as big as possible, the energy lose between transfer should be as small as possible, so it will always transfer from a device with energy larger than X to a device with energy smaller than X.
2. If X is possible to be an answer, than all value smaller than X is possible to be the final state, so we can use a binary search here.








