pub fn sum_floor_linear(n: u64, m: u64, a: u64, b: u64) -> u64
$\sum_{i=0}^{n-1} \lfloor \frac{ai+b}{m} \rfloor$