generate nested pairs within bounds for better efficiency