Problem K. Problem K. Transport Construction
时间限制 5000 ms
内存限制 512 MB
There are $n$ cities in Byteland, labeled by $1$ to $n$. The $i$-th city is located at $(x_i,y_i)$.
The Transport Construction Authority of Byteland is planning to open several bidirectional flights. Opening flight between the $i$-th city and the $j$-th city will cost $x_i\times x_j+y_i\times y_j$ dollars.
The Transport Construction Authority is now searching for the cheapest way to connect all of $n$ cities, so that every pair of different cities are connected by these flights directly or indirectly. Please write a program to find the cheapest way.
输入数据
输出数据
For each test case, print a single line containing an integer, denoting the minimum total cost.
样例输入
样例输出
$ Mathjax font initiator $