The huge problem with dividing rent this way is that it's effectively saying that a house is only as good as its bedroom. It puts the price of the kitchen, bathrooms, common spaces, yard, etc. at exactly $0. Meanwhile, those rooms are what most people use most of the day!
E.g., if one bedroom is a tiny 70 sqft and the other a whopping 210 sqft, your algorithm would have the smaller pay only 25% of the rent! Is their home life really 66% worse/cheaper just because their bedroom is small? They have equal access to the TV, couch, oven, fridge, laundry, etc. etc. etc.
It works, although I probably would have prefered to use something like the system here were I to do it over. Things like "has a master bathroom so you don't have to share with everyone else" tend to be worth more per square foot than regular bedroom space.
E.g., if one bedroom is a tiny 70 sqft and the other a whopping 210 sqft, your algorithm would have the smaller pay only 25% of the rent! Is their home life really 66% worse/cheaper just because their bedroom is small? They have equal access to the TV, couch, oven, fridge, laundry, etc. etc. etc.