When x amount of heat is given to a gas at constant pressure it perform x/3 amount of work. The average number of degrees of freedom per molecule is ?

I tried to do this by First law of thermodynamics as

$ dQ=dU + dW$

$ x-x/3 = dU$

but $dU = f/2 R dT$

so $2/3 x=f/2 R dT$

Now I am not able to find average number of degrees of freedom per molecule as temprature change is not given and also answer is not in terms of x but as integer.