Approximating a generalization of MAX 2SAT and MIN 2SAT