countDiamond (m, n) (a, b) =
    (m - off1 + 1)
        * (n + 1 - (if even b then off1 else off2))
        + (m - off2 + 1)
        * (n + 1 - (if odd b then off1 else off2))
  where
    off1 = div (a + 1) 2 + div (b + 1) 2 -- offset when diamond vertex on edge
    off2 = div a 2 + div b 2 + 1 -- offset when diamond vertex not on edge
countDiamond (m, n) (a, b) =
    (m - off1 + 1)
        * (n + 1 - (if even b then off1 else off2))
        + (m - off2 + 1)
        * (n + 1 - (if odd b then off1 else off2))
  where
    off1 = div (a + 1) 2 + div (b + 1) 2 -- offset when diamond vertex on edge
    off2 = div a 2 + div b 2 + 1 -- offset when diamond vertex not on edge
countDiamond (m, n) (a, b) =
    (m - off1 + 1)
        * (n + 1 - (if even b then off1 else off2))
        + (m - off2 + 1)
        * (n + 1 - (if odd b then off1 else off2))
  where
    off1 = div (a + 1) 2 + div (b + 1) 2 -- offset when diamond vertex on edge
    off2 = div a 2 + div b 2 + 1 -- offset when diamond vertex not on edge