1. A storage device, comprising: multiple memory blocks arranged in an array, the memory blocks including multiple memory cells, wherein a maximal number of programming cycles that a memory block of the multiple memory blocks sustains depends on a distance of the memory block from an edge of the array; and storage circuitry, configured to apply to the memory blocks programming cycles, wherein a number of programming cycles that can be applied to a respective memory block is based on a respective distance of the respective memory block from the edge of the array, and wherein the storage circuitry is configured to apply the programming cycles by associating between the memory blocks and respective weights whose values depend on the respective distances, evaluating for each of the memory blocks respective weighted counts that depend on respective numbers of programming cycles already applied to the memory blocks and on the respective weights, and distributing usage among the memory blocks based on the weighted counts.