Source: Turkey National Mathematical Olympiad 2019, Problem 5
December 23, 2019
functionalgebracombinatorics
Problem Statement
Let f:{1,2,…,2019}→{−1,1} be a function, such that for every k∈{1,2,…,2019}, there exists an ℓ∈{1,2,…,2019} such that
i∈Z:(ℓ−i)(i−k)⩾0∑f(i)⩽0.
Determine the maximum possible value of
i∈Z:1⩽i⩽2019∑f(i).