local n, m = io.read("*n", "*n") local t = {} for i = 1, n do t[i] = 0 end for i = 1, m do local z = i while z <= n do t[z] = t[z] - i z = z + i end end t[1] = m - 1 for i = 2, n do t[i] = m + t[i] + t[i - 1] end local a = 0 for i = 1, n do a = math.max(a, t[i]) end print(a)