Working with cases with 1 terrain to allocate and 2 terrains to allocate, implementing now the generic A* for all the other cases.