A sharp change in the climate let invasive species spread through many rivers of Daegwak. The government discussed the problem and settled on the Flat Dumpling Plan: skip a stone across a river and wipe out the invasive species in the cells the stone touches.
The river picked for the plan has width L, and the river is modeled as L consecutive cells numbered 1 through L. The environment ministry scored every cell by how dangerous the species living there is. Some cells hold native species, so a score can be negative.
Throwing two or more stones makes your arm hurt, so exactly one stone is thrown. Depending on the power of the throw, the stone bounces at a fixed interval d (1≤d≤L), passing over cell d, then cell 2d, and so on up to cell ⌊L/d⌋d. Find the natural number d that maximizes the sum of the scores of the cells the stone passes over.