I already answered the first part. For the second part the max profit is from the formula before 2x+3y. We know that y must be at least 3 times more than x with a max of 36 total. Since y give more profit than x i would want to sell all y. So 36*3 =108