The partitioning of Dy and Tb in NdFeB magnets: A first-principles study