China's factory inflation hits 4-year high at 3.9% as energy costs surge