If atom X with six electrons in its outermost shell combines with atom Y with…