404193: GYM101446 G Parabolas
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
G. Parabolastime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output
There are n parabolas in the plane determined by equations y = (x - ai)2 + bi. Parabolas cut the plane into several parts (either finite or infinite) of positive area. Your task is to count the number of those parts.
InputThe first line of the input contains one integer n (1 ≤ n ≤ 1000) — number of parabolas. Each of the next n lines contains two integers — coefficients ai and bi (|ai| ≤ 109, |bi| ≤ 109).
OutputPrint one integer — the number of positive area parts that the plane is cut into.
ExamplesInput4Output
0 0
1 1
0 1
2 1
10Input
3Output
2 4
3 4
2 4
4