Interesting. The resource equation can be rewritten in different ways.
Check them out here:
http://www.wolframalpha.com/input/?i=a+%3D+5+%2B+b+%2B+c+%2B+d%2F5
x(a + 5b + 10c + 20d + 50e) is the other equation for cost finding.
Test
10(1 + 5 + 10 + 20 + 300)
Simplify
10 + 50 + 100 + 200 + 3000
Solve
10 + 50 + 100 + 200 + 3000
60 + 300 + 3000
3300
3360
It works.
ax + x(5b + 20d + 50e) + 10cx
Test
1 * 10 + 10(5 + 20 + 300) + 10 * 10
Simplify
1 * 10 + 50 + 200 + 3000 + 10 * 10
Solve
10 + 50 + 200 + 3000 + 100
60 + 300 + 3000
3360
It works.