print((function (f, g, _, s) return f(g(s)) end)(function (a) local r = #a>1 and a[2]-a[1] or 0 for i=2,#a-1 do if a[i+1]-a[i]