Norm 2: ?➝A: ?➝B: ?➝C: Fix 0: 1➝D: Lbl 0: Rnd(DAB+0.5)➝X: X=DAB+1⇒X-1➝X: X≥DAB⇒X≤DAC⇒Goto 1: D+1➝D: Goto 0: Lbl 1: Norm 2: D◢ X◢ X÷D÷A
I don't know how to call this program but I used it to set prices for things in games where you can only exchange integer amount of currency and items.
So for example lets say that 3 fubars costed you 5.46 jubas to make and you want to sell fubars with profit between 15% and 20%. You would type 5.46/3 for A, 1.15 for B and 1.20 for C. Then the program will tell you that you need to sell 6 fubars for 13 jubas at an ~19% profit.