You are given an integer budget and a items, where items[i] = [factor_i, price_i] represents the factor and price of item i.
You can purchase any number of copies of each item as long as the total cost of all purchased items does not exceed budget.
For each purchased copy of item i, you receive j (where j i) if $ ext{factor}_i$ divides $ ext{factor}_j$. If no such item j exists, you do not receive a free copy for that purchased item.
Return the maximum total number of items, including both purchased and free copies, that you can obtain.
Constraints:
items.length
items[i]
items.length
budget
You are given an integer budget and a items, where items[i] = [factor_i, price_i] represents the factor and price of item i.
You can purchase any number of copies of each item as long as the total cost of all purchased items does not exceed budget.
For each purchased copy of item i, you receive j (where j i) if $ ext{factor}_i$ divides $ ext{factor}_j$. If no such item j exists, you do not receive a free copy for that purchased item.
Return the maximum total number of items, including both purchased and free copies, that you can obtain.
Constraints:
items.length
items[i]
items.length
budget