How is this not a waste when you could've just stopped at 4 and gotten 14 Rs worth for 6 (+8) instead of 21 Rs worth for 15 (+6)?
It's really not that difficult, just stop enhancing once it costs more than (or the same) you get out of it. Going further is a complete waste. I don't quite see how optimizing will be any different for FLB. If X is the amount of Rs you need for a level, then just use X/14 SRs and X mod 14 Rs and if you wanna save on SRs, then just use X/14 - 1 SRs for every X mod 14 < 4 (6 if X = 20) and add 14 Rs instead. Really just gotta know basic addition and multiplication and how many Rs each weapon/grail is worth.