package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
)
type Point struct {
id int
x int64
y int64
}
type Pair struct {
u, v int
dx int64
dy int64
}
func half(dy int64) int {
if dy < 0 {
return 1
}
return 2
}
func search(pts []Point, p Pair, target int64) int {
l, r := 0, len(pts)-1
for l <= r {
m := l + (r-l)/2
valM := p.dx*pts[m].y - p.dy*pts[m].x
if valM == target {
return m
}
if valM < target {
l = m + 1
} else {
r = m - 1
}
}
return -1
}
func main() {
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanWords)
scanInt64 := func() int64 {
scanner.Scan()
res, _ := strconv.ParseInt(scanner.Text(), 10, 64)
return res
}
if !scanner.Scan() {
return
}
n, _ := strconv.Atoi(scanner.Text())
S := scanInt64()
pts := make([]Point, n)
for i := 0; i < n; i++ {
pts[i].id = i
pts[i].x = scanInt64()
pts[i].y = scanInt64()
}
sort.Slice(pts, func(i, j int) bool {
if pts[i].x != pts[j].x {
return pts[i].x < pts[j].x
}
return pts[i].y > pts[j].y
})
pos := make([]int, n)
for i := 0; i < n; i++ {
pos[pts[i].id] = i
}
pairs := make([]Pair, 0, n*(n-1)/2)
for i := 0; i < n; i++ {
for j := i + 1; j < n; j++ {
u := pts[i]
v := pts[j]
pairs = append(pairs, Pair{
u: u.id,
v: v.id,
dx: v.x - u.x,
dy: v.y - u.y,
})
}
}
sort.Slice(pairs, func(i, j int) bool {
p1 := pairs[i]
p2 := pairs[j]
h1 := half(p1.dy)
h2 := half(p2.dy)
if h1 != h2 {
return h1 < h2
}
cross := p1.dx*p2.dy - p1.dy*p2.dx
return cross > 0
})
for _, p := range pairs {
posU := pos[p.u]
posV := pos[p.v]
if posU > posV {
posU, posV = posV, posU
}
valU := p.dx*pts[posU].y - p.dy*pts[posU].x
target1 := valU + 2*S
target2 := valU - 2*S
idx1 := search(pts, p, target1)
if idx1 != -1 {
fmt.Println("Yes")
fmt.Printf("%d %d\n", pts[posU].x, pts[posU].y)
fmt.Printf("%d %d\n", pts[posV].x, pts[posV].y)
fmt.Printf("%d %d\n", pts[idx1].x, pts[idx1].y)
return
}
idx2 := search(pts, p, target2)
if idx2 != -1 {
fmt.Println("Yes")
fmt.Printf("%d %d\n", pts[posU].x, pts[posU].y)
fmt.Printf("%d %d\n", pts[posV].x, pts[posV].y)
fmt.Printf("%d %d\n", pts[idx2].x, pts[idx2].y)
return
}
pts[posU], pts[posV] = pts[posV], pts[posU]
pos[pts[posU].id] = posU
pos[pts[posV].id] = posV
}
fmt.Println("No")
}