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.