package main import ( "bufio" "fmt" "math" "os" ) func main() { // use bufio for fast I/O scanner := bufio.NewScanner(os.Stdin) // read the length of the sequence var n int scanner.Scan() fmt.Sscan(scanner.Text(), &n) // read the sequence var x []int for i := 0; i < n; i++ { var xi int scanner.Scan() fmt.Sscan(scanner.Text(), &xi) x = append(x, xi) } // compute the sum of sqrt(xi) for each k for k := 0; k < n; k++ { var sum float64 for i := 0; i <= k; i++ { sum += math.Sqrt(float64(x[i])) } fmt.Printf("%.16f\n", sum) } }