TeX source:
O(mn)