you spend 700 units of A when you have more than 700, and 90 units of b when you have more than 90. so, for example, if you wanted 2 items, it'll take you 5 weeks because 5 times 286A is 1430A and 5 times 14B is 70B. (You can buy 2 items with 1430A)
Supposing that i is 1 item, and w is 1 week:
Do A(i)=(700/286)w=(350/143)w and round that up to 3w. And for A(2i) it will be 2(350/143)w=(700/143)w then rounded up to 5w, and so on...
For B(i) it will be (90/14)w=(45/7)w and you round it up to 7w. And for B(2i) it will be 2(45/7)w=(90/7)w rounded up to 13w, and so on...
The formula for A is i=(350/143)w, and formula for B is i=(45/7)w.
Then you find a common multiple, which is the 2 multiplied together, and find how many i is in that. So, in (350/143)(45/7)w=(2250/143)w, you can buy ((350/143)+(45/7))i=(8885/1001)i.
So, the formula is (8885/1001)i=(2250/143)w. This can be simplified to i=((2250/143)/(8885/1001))w=(2250/143)(1001/8885)w
But, you need to add 1 as it initial starting amount of weeks. You can get 1 item in (2250/143)(1001/8885) weeks, And just to make life easier, (2250/143)(1001/8885) is approx 1.7726504
Remember, you can't get a week in a fraction, so you have to round it up every answer.
To get 100 items, you will need 179 weeks ((1.7726504 x 100 rounded up)+1). In 179 weeks, you will get: (286x179)A=51194A to buy (51194/700)= rounded down to 73 items. You will also get (14x179)B=2506B to buy (2506/90)= rounded down to 27 items. 27 items plus 73 items is 100 items.
To get 270 items, you will need 480 weeks ((1.7726504 x 270 rounded up)+1). In 480 weeks, you will get: (286x480)A=137280A to buy (137280/700)= rounded down to 196 items. You will also get (14x480)B=6720B to buy (6720/90)= rounded down to 74 items. 74 items plus 196 items is 270 items.
Final formula: (punch it into your calculator and it'll work)