← Home
```go
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

type Point struct {
	x, y, z float64
}

func minus(a, b Point) Point {
	return Point{a.x - b.x, a.y - b.y, a.z - b.z}
}

func plus(a, b Point) Point {
	return Point{a.x + b.x, a.y + b.y, a.z + b.z}
}

func scale(s float64, p Point) Point {
	return Point{s * p.x, s * p.y, s * p.z}
}

func dot(a, b Point) float64 {
	return a.x*b.x + a.y*b.y + a.z*b.z
}

func dist(a, b Point) float64 {
	dx := a.x - b.x
	dy := a.y - b.y
	dz := a.z - b.z
	return math.Sqrt(dx*dx + dy*dy + dz*dz)
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	n, _ := strconv.Atoi(strings.TrimSpace(scanner.Text()))

	points := make([]Point, n+1)
	for i := 0; i <= n; i++ {
		scanner.Scan()
		parts := strings.Fields(scanner.Text())
		points[i].x, _ = strconv.ParseFloat(parts[0], 64)
		points[i].y, _ = strconv.ParseFloat(parts[1], 64)
		points[i].z, _ = strconv.ParseFloat(parts[2], 64)
	}

	scanner.Scan()
	parts := strings.Fields(scanner.Text())
	vp, _ := strconv.ParseFloat(parts[0], 64)
	vs, _ := strconv.ParseFloat(parts[1], 64)

	scanner.Scan()
	parts = strings.Fields(scanner.Text())
	px, _ := strconv.ParseFloat(parts[0], 64)
	py, _ := strconv.ParseFloat(parts[1], 64)
	pz, _ := strconv.ParseFloat(parts[2], 64)
	P := Point{px, py, pz}

	cum := make([]float64, n+1)
	cum[0] = 0
	for i := 1; i <= n; i++ {
		cum[i] = cum[i-1] + dist(points[i-1], points[i])
	}

	k := vp / vs

	const eps = 1e-9

	if dist(P, points[0]) < eps {
		fmt.Println("YES")
		fmt.Printf("%.10f\n", 0.0)
		fmt.Printf("%.10f %.10f %.10f\n", points[0].x, points[0].y, points[0].z)
		return
	}

	for seg := 1; seg <= n; seg++ {
		a := points[seg-1]
		b := points[seg]
		V := minus(b, a)
		lensq := dot(V, V)
		len_ := math.Sqrt(lensq)
		cum_ := cum[seg-1]
		W := minus(P, a)
		gamma := dot(W, W)
		beta := -2 * dot(W, V)
		alpha := lensq
		mu := k * k * lensq
		nu := 2 * k * k * cum_ * len_
		rho := k * k * cum_ * cum_
		Ap := alpha - mu
		Bp := beta - nu
		Cp := gamma - rho

		var minf float64 = -1
		if math.Abs(Ap) < eps {
			if math.Abs(Bp) < eps {
				if Cp <= eps {
					minf = 0
				}
			} else {
				root := -Cp / Bp
				if Bp > 0 {
					if root >= -eps && math.Min(1.0, root) >= -eps {
						minf = 0
					}
				} else {
					start := math.Max(0.0, root)
					if start <= 1+eps {
						minf = start
					}
				}
			}
		} else {
			D := Bp*Bp - 4*Ap*Cp
			if D <= eps {
				minf = 0
			} else {
				sd := math.Sqrt(D)
				r1 := (-Bp - sd) / (2 * Ap)
				r2 := (-Bp + sd) / (2 * Ap)
				if r1 > r2 {
					r1, r2 = r2, r1
				}
				minf_ := 2.0
				if r1 >= -eps {
					minf_ = 0
				}
				startr := math.Max(0.0, r2)
				if startr <= 1+eps {
					if startr < minf_ {
						minf_ = startr
					}
				}
				if minf_ <= 1+eps {
					minf = minf_
				}
			}
		}

		if minf >= -eps/10 {
			ff := minf
			if ff < 0 {
				ff = 0
			} else if ff > 1 {
				ff = 1
			}
			S := plus(a, scale(ff, V))
			dd := cum_ + ff * len_
			tt := dd / vs
			fmt.Println("YES")
			fmt.Printf("%.10f\n", tt)
			fmt.Printf("%.10f %.10f %.10f\n", S.x, S.y, S.z)
			return
		}
	}
	fmt.Println("NO")
}
```