Type-based amortized resource analysis with integers and arrays*. (29th October 2015)