p := [][]int64{{8, 10}, {12, 14}}
s := [][]int64{{7, 9}, {13, 15}}
fmt.Printf("res: %v ", solve(p, s))
func solve(p, s [][]int64) (res [][]int64) {
for _, sItem := range s {
for _, pItem := range p {
case sStart <= pStart && sEnd >= pEnd:
res = append(res, []int64{pStart, pEnd})
case sStart <= pStart && sEnd > pStart && sEnd < pEnd:
res = append(res, []int64{pStart, sEnd})
case sStart > pStart && sStart < pEnd && sEnd >= pEnd:
res = append(res, []int64{sStart, pEnd})
case sStart > pStart && sEnd < pEnd:
res = append(res, []int64{sStart, sEnd})