  We prove that Knapsack problem (KP) is undecidable for any group of
nilpotency class two if the number of generators (without torsion) of the
derived subgroup is at least 322. This result together with the fact that if KP
is undecidable for a subgroup then it undecidable for the whole group allows us
extend our result to certain classes of polycyclic groups, linear groups and
nilpotent groups of higher nilpotency class.
