Number of Burgers with No Waste of Ingredients

鸡兔同笼

class Solution {
    public List<Integer> numOfBurgers(int t, int c) {
        List<Integer> res = new ArrayList<>();
        if(t % 2 != 0)
            return res;
        int h = t / 2;
        int z = h - c;
        if(z < 0 || c - z  < 0)
            return res;
        res.add(z);
        res.add(c-z);
        return res;
    }
}