solve partitioning