Divide file based on number of devices

Added code to make equal ranges of file based in the number of peers.
And one part will be assigned to server as well.