Suppose there is a certain parent with a fixed width and his daughter. Let it be an unnumbered horizontal list.
List items have a minimum width and indent between them. If we have n elements of the list, then they are arranged inside the element along a certain grid. The problem is that the width of the daughter is unknown and may exceed the minimum width.
It is also necessary in this case to build elements along the grid.
Tell me which way to dig. And then something finally comes to mind.
For clarity, an example. Imagine that the blocks in the first row have the same distance from each other and are aligned on a grid. 
UPD
Here I was rightly reproached with the incorrect formulation of the task. Well, I don’t understand what needs to be done, respectively; I don’t understand how to explain it. I'll try to clarify. I am trying to implement a functional for my daughter: li {min-width: 20%; float: left;}
if width> 20%, element.style{width:40%}
if width> 40%, element.style{width:60%}
if width> 60%, element.style{width:80%}
if width> 80%, element.style{width:100%}
I just really don’t understand how to start at all and how to approach. Therefore, such a mess with the wording.
Although now formulated. It seems to become clearer. It is necessary to obtain the width of the element, compare it with the fixed width of the parent, and depending on the result obtained, prescribe its style. Thank you Sasha Omelchenko for organizing thoughts.
But something from my decision still smacks of a wild crutch and the load on the user.