Julias n friend want organize startup new country move they assign number 1 n accord job frontend task backend one they estimate matrix c c_ij c_ji average number message month people job jNow want hierarchy tree it binary tree node contain member team some member select leader team contain root node in order leader able easily reach subordinate node v tree follow apply member leave subtree small number v member right subtree large number vAfter hierarchy tree settle people job j communicate short path tree nod Lets denote length path d_ij thus cost communication c_ij cdot d_ijyour task find hierarchy tree minimize total cost communication pair sum_1 le j le n c_ij cdot d_ij