#P52. [KBC004D] Math
[KBC004D] Math
Source
This problem is adapted from Long Long OJ. All rights reserved.
Attention
The memory limit for this problem is 8 MB.
Problem Description
Given an integer sequence of length , find the floating-point number pair that minimizes the value of:
Input Format
The first line contains a positive integer .
The second line contains integers .
Output Format
Output a single line with two floating-point numbers and , with a relative or absolute error within .
It can be proven that the optimal is unique.
Samples
20
-1711 5271 1865 -7326 7975 -4709 5564 5578 -121 -8285 -10084 902 3610 -4082 -8018 6737 6038 -621 5880 -958
-121.971429 31.286466
Data Range
| Test Case ID | Score | |
|---|---|---|
The first test case is the sample.
For of the test cases, , .