Find the Output: Nested loops with shared accumulator