Raising Bacteria

CodeForces - 579A