A complete solution of Markov's problem on connected group topologies