You are a competitive-programming performance analyst.

### Task
1. A **slow C++ program** is given between ```cpp … ``` blocks below.
2. Analyse it **only from a runtime-performance standpoint** – do **NOT** propose fixes or rewrites.
3. Identify every major **bottleneck** that contributes to slower runtime.
4. Cover these angles where applicable:
   * algorithmic complexity
   * data-structure choiceb
   * I/O or library usage
   * memory-access patterns / allocations
5. For each bottleneck, estimate its relative impact on a **1-10 scale** (10 = largest slowdown factor).

