#P8720. [蓝桥杯 2020 省 B2] 平面切分

[蓝桥杯 2020 省 B2] 平面切分

Problem Description

There are NN straight lines on a plane. The ii-th line is y=Aix+Biy=A_{i} \cdot x+B_{i}

Compute how many regions these lines divide the plane into.

Input Format

The first line contains an integer NN

The following NN lines each contain two integers Ai,BiA_{i}, B_{i}

Output Format

Output one integer representing the answer.

3
1 1
2 2
3 3
6

Hint

For 50%50\% of the testdata, 1N4,10Ai,Bi101 \leq N \leq 4, -10 \leq A_{i}, B_{i} \leq 10

For all testdata, $1 \leq N \leq 1000, -10^5 \leq A_{i}, B_{i} \leq 10^5$。

Lanqiao Cup 2020, second round of the provincial contest, Group B, Problem I.

Translated by ChatGPT 5