Here is my problem:
- There are Russian companies products.
- All products must be distributed in k days
- The distribution of Ci products must be consistent - which means that it can be distributed on days 2,3,4,5, but not 2,3,6,7
- the number of distributed products by Ci on day j should be less than (or equal to) on day j-1 (if they were on day j-1)
- the difference between the distributed products between days i and j should not exceed 1
Example:
We have 3 days to distribute the products. Company A Products: a, a, a, a, a. Company B Products: b, b, b. Company Products C: c, c
Fair distribution:
[AAB, AABC, abc]
Invalid distribution:
[AABC, AABC, AB] because on the 1st day there are 4 products, on the 3rd day there are 2 products (difference> 1)
Invalid distribution:
[ABC, AABC, AAB] because on the 1st day there is one product A, and on the 2nd day there are 2 products A, so the distribution of product A does not decrease.
EDIT
if there is a case that makes distribution impossible, please provide a brief description, I will accept the answer
dfens source
share