Build a marginal tax calculator
Haskell, 67 66 bytes

Thanks Damien for -1 byte.

This solution is in the form of an infix function, ?, of type (Integral b, RealFrac r) =&gt; [(r, r)] -&gt; r -&gt; b. The helper function, #, does the required calculations while ? serves to handle the IO specifications.

a?b=floor$reverse a#b
((m,p):r)#i|v&lt;-min i m=p/100*(i-v)+r#v
_#_=0