# Segment Set - Segment Intersections: Manhattan Geometry

Time Limit : 2 sec, Memory Limit : 65536 KB

# i}nb^􉽁j

$x$ ܂ $y$ ɕs $n$ {̐^̂ŁǍ_̐o͂ĂB

Psڂɐ̐ $n$ ^܂B $n$ s $n$ {̐^܂Bě͎ŗ^܂B

$x_1 \; y_1 \; x_2 \; y_2$

͐̒[_̂ꂼ̍WłBׂ͂͂Đŗ^܂B

## o

_̐Psɏo͂ĂB

• $1 \leq n \leq 100,000$
• $-1,000,000,000 \leq x_1, y_1, x_2, y_2 \leq 1,000,000,000$
• ݂ɕsȂQȏ̐A邢͓_ŏdȂ邱Ƃ͂ȂB
• _̐ $1,000,000$ 𒴂ȂB

## ͗ 1

6
2 2 2 5
1 3 5 3
4 1 4 4
5 2 7 2
6 1 6 3
6 5 6 7


## o͗ 1

3
`