P8720 [Lanqiao Cup 2020 NOI Qualifier B2] Plane Partition

Description

There are $N$ straight lines on a plane. The $i$-th line is $y=A_{i} \cdot x+B_{i}$。 Compute how many regions these lines divide the plane into.

Input Format

The first line contains an integer $N$。 The following $N$ lines each contain two integers $A_{i}, B_{i}$。

Output Format

Output one integer representing the answer.

Explanation/Hint

For $50\%$ of the testdata, $1 \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