A necessary and sufficient condition of optimality for a class of multidimensional control problems. (23rd July 2020)