When 500J heat is given to a gas at constant pressure, it performs 500/3 J work. Find the average number of degrees of freedom per molecule of gas.
(A) 3
(B) 4
(C) 5
(D) 6