Minimizing a unimodal function of two integer variables