4. It is known that on the planet XMO there are one hundred million cities. Initially, there are no flight routes between the cities. Now, an airline plans to establish 5050 two-way routes, each connecting two different cities, and no two routes will connect the same pair of cities. The "prosperity" of each city is defined as the number of routes originating from that city, and the "revenue" of each route is the product of the prosperity of the two cities it connects.
Find the maximum possible value of the sum of the revenues of these 5050 routes.
Consider cities as vertices and routes as edges, forming a graph $G$. The revenue of each route is the product of the degrees of the two vertices it connects. Let there be $k$ points $A_{1}, A_{2}, \cdots, A_{k}$ with non-zero degrees, and the degree of $A_{i}$ is $a_{i}(1 \leqslant i \leqslant k)$. Let $n=5050$, then $a_{1}+a_{2}+\cdots+a_{k}=2 n$, where $1 \leqslant a_{i} \leqslant k-1(1 \leqslant i \leqslant k)$.
For a point $A_{i}$, we estimate the sum of the revenues of all routes starting from $A_{i}$. Let the $k-1$ other points connected to $A_{i}$ be $A_{j_{1}}, \cdots, A_{j_{a_{i}}}$, and the points not connected to $A_{i}$ be $A_{l_{1}}, \cdots, A_{l_{k-1-a_{i}}}$.
Since $d\left(A_{j_{1}}\right)+\cdots+d\left(A_{j_{a_{i}}}\right)+d\left(A_{l_{1}}\right)+\cdots+d\left(A_{l_{k-1-a_{i}}}\right)=2 n-a_{i}$, and $d\left(A_{l_{s}}\right) \geqslant 1\left(1 \leqslant s \leqslant k-1-a_{i}\right)$, then $d\left(A_{j_{1}}\right)+\cdots+d\left(A_{j_{a_{i}}}\right) \leqslant 2 n-a_{i}-\left(k-1-a_{i}\right)=2 n-k+1$, meaning the sum of the degrees of the points connected to $A_{i}$ is $\leqslant 2 n-k+1$, thus the sum of the revenues of all routes starting from $A_{i}$ is $\leqslant a_{i}(2 n-k+1)$.
Therefore, the total revenue of all routes is $\leqslant \frac{1}{2}\left(a_{1}+a_{2}+\cdots+a_{n}\right)(2 n-k+1)=n(2 n-k+1)$.
Noting that $k$ points can have at most $C_{k}^{2}=\frac{1}{2} k(k-1)$ edges, then $5050 \leqslant \frac{1}{2} k(k-1) \Rightarrow k \geqslant 101$, so the total revenue is $\leqslant n(2 n-101+1)=5050 \times 10000=50500000$.
Construct the graph $G$: Select any 101 cities, and ensure that any two cities have a bidirectional route, at this point the graph $G$ has $C_{101}^{2}=5050$ edges, and the revenue of each edge is $100 \times 100=10000$, the total revenue is 50500000.
In summary, the maximum possible value of the total revenue of these 5050 routes is 50500000.