Optimal switching for linear quadratic problem of switched systems in discrete time. (April 2017)