This question is mainly related to programming else than just only a math problem, I am developing a system where there will be multiple pages of contents, the contents are coin types and I need to generate a page showing those coin types, the main problem is that the value of the coin types can increase a lot.
Each page can support up to a max of 2880 coin values, but there can be cases where the total coin values would be a number value higher than 300k, meaning an algorithm that generated all pages at once would not be efficient.
A page can end up having multiple content types as long as their sum is less or equal 2880, examples:
Page1:
BONE: 2880
Page2: BONE: 230 ARROW: 532
I would have some sort of logic where if I asked for the contents of page 1 it would tell me bone 2880, as well as if I asked for contents of page 2 would return what page 2 has.
I know the total number of currency values and types, meaning I have a Map<String,Integer> where the key is the name of the currency type, but the value is not formatted into pages etc, it is a number that can be 0 to Integer.MAX_VALUE.
Does anyone have some idea on how I could do this? logical answer helps, it does not have to be in any form of code, I just need help with the logic and math behind it.