#541. 「Nowcoder多校 2019 Day1」Euclidean Distance
「Nowcoder多校 2019 Day1」Euclidean Distance
题目描述
Bobo has a point A in the n dimension real space , whose coodinate is where and m are both integers. He wants to find another point meeting the following requirements.
- . That is, they are real numbers.
- The (squared) Euclidean distance between P and A, which is , is minimized.
It can be proved the minimum is always a rational number. Print the squared distance in fraction. Note to print an integer n as n
instead of n/1
.
输入格式
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m. The second line contains n integers .
- The sum of n does not exceed .
输出格式
For each test case, print a fraction which denotes the result.
样例
样例输入 1
1 1
0
2 3
1 2
3 10
1 -2 3
样例输出 1
1
0
16/75