#!/bin/bash read N L=$((N - 1)) declare -a products # Phase 1: Query (j, L) for all j < L nonzero=() for ((j=0; j