[Java/C++/Python]  Chickens and Rabbits
Intuition\nClassic problem, https://w.wiki/D2S\nSorry that I don\'t know the name in English.\nMaybe  Chickens and Rabbits problem\n\n\n# Explanation\ntomate nu
# **Intuition**\nClassic problem, https://w.wiki/D2S\nSorry that I don\'t know the name in English.\nMaybe  Chickens and Rabbits problem\n<br>\n\n# **Explanation**\ntomate number `t` should not be odd,\nand it should valid that `c * 2 <= t && t <= c * 4`.\n\nFrom\n`jumbo + small = cheese`\n`jumbo * 2 + small = tomate / 2`\n\nWe can get that\n`jumb0 = tomate / 2 - cheese`\nSo that\n`small = cheese * 2 - tomate / 2`\n<br>\n\n# **Complexity**\nTime `O(1)`\nSpace `O(1)`\n<br>\n\n**Java:**\n```java\n    public List<Integer> numOfBurgers(int t, int c) {\n        return t % 2 == 0 && c * 2 <= t && t <= c * 4 ? Arrays.asList(t / 2 - c, c * 2 - t / 2) :  new ArrayList();\n    }\n```\n\n**C++:**\n```cpp\n    vector<int> numOfBurgers(int t, int c) {\n        if (t % 2 == 0 && c * 2 <= t && t <= c * 4)\n            return {t / 2 - c, c * 2 - t / 2};\n        return {};\n    }\n```\n\n**Python:**\n```python\n    def numOfBurgers(self, t, c):\n        return [t / 2 - c, c * 2 - t / 2] if t % 2 == 0 and c * 2 <= t <= c * 4 else []\n```\n
[]