**Difficulty:** Medium

**Pre-requisites:** Mathematics

**Problem link:**

**Problem:**

An amoeba of generation **i** divides itself into **A _{i}** amoebas and takes

**X**days to divide. Find the number of amoebas left after M days.

**Explanation:**

We are starting with one amoeba. After X days we would have sum = 1+A_{1} amoebas, after X more days we will have sum = sum+A_{2} amoebas. The process is to be continued M-1 times to compute the number of amoebas left post M days.

**Problem setterâ€™s solution:** SOLUTION