What do you think the flashlight is for?
There is only one battery in the whole building, but it is enough.
In the words of Doc Emmet Brown, "You're not thinking fourth dimensionally!".
So reconsider, have another think about how you could solve this.
If you think of something, test it out before reading the solution.

If you are still stuck, here is an explicit solution.