c++ 2 line solution with explanation ( using simple math)
\n class Solution {\npublic:\n    vector<int> numOfBurgers(int t, int c) {\n        if(t < 2*c || t % 2 || t > 4*c) return {};\n        return {(t - 2*c) / 2, c
```\n class Solution {\npublic:\n    vector<int> numOfBurgers(int t, int c) {\n        if(t < 2*c || t % 2 || t > 4*c) return {};\n        return {(t - 2*c) / 2, c - (t - 2*c)/2};\n    }\n};\n\n// if tomato slices are less than the 2*cheese slices then we can\'t use all cheese slice.\n// if tomato slices are odd then we can\'t use all tomato slices\n// if tomato slices are more than the cheese slices then we can\'t use all tomato slices\n// initially we assume that all burgers are small one(small burger = number of cheese slice). Now the half of the remaning tomato slice (remaining tomato slice = t - 2*c) can make big burger so remove it from small burger.\n```
[]