USAMO 2026 (Problem 1)

Let nn be an integer greater than 11. For which real numbers xx is
⌊nx⌋−∑k=1n⌊kx⌋k\lfloor nx\rfloor-\sum_{k=1}^{n}\frac{\lfloor kx\rfloor}{k}
maximal, and what is the maximal value that this expression can take? Note: ⌊z⌋\lfloor z\rfloor denotes the greatest integer less than or equal to zz.