Simple Python Solution
Complexity\n- Time complexity:\n- O(n\uFF3E2)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\n- O(n)\n Add your space complexity here, e.g. 
# Complexity\n- Time complexity:\n- $$O(n\uFF3E2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n- $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countOfPairs(self, n: int, x: int, y: int) -> List[int]:\n        result = [0] * n\n        for i in range(1, n + 1):\n            for j in range(i + 1, n + 1):\n                d = min(abs(i - j), abs(i - x) + abs(j - y) + 1, abs(i - y) + abs(j - x) + 1)\n                result[d-1] += 2\n        return result\n```
['Python3']