Some of these variables (A, at a minimum) can be reused between the two problem types.