Dis1(int x0, y0, n,m) { c1 := c2 := 0; x := x0; y := y0; while (x < n) if (y < m) y := y + 1; c1++; else x := x + 1; c2++; }