The function
f is piecewise linear with breakpoints at
x=k1. On the interval
[m1,m−11] its slope is
k=m∑119k−k=1∑m−1k=7140−(m−1)m, where
7140=2119⋅120.
This slope is zero when
(m−1)m=7140, i.e.
m=85, so the minimum occurs at the right endpoint
x=841.
There, terms with
k≤84 contribute
8484−k and terms with
k≥85 contribute
84k−84, so
f(841)=843486+84630=41.5+7.5=49.
Thus,
A is the correct answer.