Review Time
Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others) total submission (s): 5093 Accepted S Ubmission (s): 3754
Problem Description
In order to have a good year, XHD began to review, so every night carrying books to the classroom run. XHD Review has a habit, after reviewing a course, he always pick a more simple lesson to review, and he review the efficiency of the course for two courses of the difficulty of the square, and review the efficiency of the first course for 100 and this course of the square of the difficulty difference. XHD This semester chose N course, but one night he can only review M course, ask him to review the maximum efficiency of the night is how much?
Input
The first line of the input data is a data T, which indicates that there is a T group of data.
The first line of data for each group is two integers n (1 <= n <=), m (1 <= m <= N).
Then there are n rows, each with a positive integer a (1 <= a <= 100), indicating the difficulty of the course.
Output
For each set of input data, output an integer that represents the highest efficiency value.
Sample Input
2
2 2
52
25
12 5
89
64
6
43
56
72
92
23
20
22
37
31
Sample Output
5625
8836
Author
Xhd
Source
ACM Program Design Final Exam-warm-up (Thanks XHD & 8600)
The main topic: give you n number, the maximum number of m, the number of m from large to small arrangement, to seek the adjacent square difference (first
The number squared difference is the difference between the number and 100) makes the squared difference and the maximum.
Idea: Actually, it's not that complicated. Take the number of 1~m from the n number. Take only a minimum value (100-min) ^2
You can do it. The problem of the very pit .....
HDU2078 review Time "water Problem" "Mathematics"