We use the least-squares method for inconsistent systems to find a new allocation rule for rationing and surplus problems. In particular, we study allocation problems considering different priorities to satisfy the agents’ demands, which influence how the distribution is carried out. The new distribution rule is proposed by choosing different inner products defined in linear algebra and providing explicit formulas for assigning resources to the agents. Moreover, we illustrate how it can recover different allocation rules by adequately defining the priorities. As an application of the rationing problem with priority agents, we consider real data for allocating police officers in the states of Mexico. In this example, the agents represent the states of Mexico, and their priorities were established based on the criminal incidence. Also, we compute and compare the resource distribution given by classic allocation rules and the percentage of loss obtained with each one.