Update calculating max weigth of resources

[#58301200]