Section 36 of the Indian Penal Code, 1860 states that where causing a certain effect, or an attempt to cause that effect, by an act or illegal omission is an offence, the causing of that effect partly by act and partly by illegal omission is the same offence. In this scenario, A intentionally causes Z's death, which is the definition of murder under Section 300 IPC, and this death is caused partly by an illegal omission (not giving food) and partly by an act (beating).