https://blog.lkwplus.com/posts/amortized-analysis/