DIM A, B, T, M, R AS INTEGER
A = -9: B = 9
M = A: R = F(A)
FOR T = A TO B
IF F(T) <= R THEN
M = T
R = F(T)
END IF
NEXT T
PRINT M+R
FUNCTION F(x)
IF x>0 THEN
F = (x*x-10)*(x*x-10) + 9
ELSE
F = (x*x-6)*(x*x-6) + 6
END IF
END FUNCTION