SimpleSingle2(int n,m) x := 0; y := 0; while (*) if (x < n) x++; y++; else if (y < m) x++; y++; else break;