find minimum value of K so that all types of collisions are possible.