Formation energy of dangling bonds on hydrogenated diamond surfaces: A first-principles study