Work done : ∫v2v1pdv
We can decompose the path ABCDEFGHA into A->B->C->D->E->F->G->H->A
WXY= work done from X to Y
Since from A->B, pressure is P0, WAB=P0(V0−3V0)=−2P0V0
Since there is no change in volume from B->C, WBC=0
WCD=(4P0)(3V0)=12P0V0
WDE=0 in the same manner as WBC
WEF=−4P0V0
WFG=0
WGH=3P0V0
WHA=0
Adding all, WABCDEFGHA=9P0V0