(Block-based) Nested-loop algorithm for ×