Interplay between k-core and community structure in complex networks