Solved by 32 users: Jacob, MasterZerg, Ravent, mikleb, DD, tomek, dan, swistak, marek.cygan, maciejk, Rizvanov, crazyb0y, tourist, WsemirZ, JohnJones_001, Chmeli_BSU, DAV, zloy_mipt, mazahaka, RAVEman, defrager, Bogolubsky, fetetriste, TTLovePP, Yagi_Arthur, Dest, ripatti, Kuznetsov_S, Progger, LiuChenheng, regmar, NIGHTFIT.
UserDateAttemptTimeCMSC
DAV`04 jun 2009`C++1900.14543
DAV`22 may 2009`C++1800.14545
DAV`22 may 2009`C++1000.14607
DAV`22 may 2009`C++900.14617
Rizvanov`22 jan 2008`C++100.52676
tomek`07 mar 2007`C++700.52676
Jacob`06 dec 2006`Java300.98696
RAVEman`12 jan 2009`C++700.44816
TTLovePP`31 dec 2009`C++400.60866
fetetriste`28 dec 2009`C++1601.58903
JohnJones_001`24 jun 2008`C++500.63934
NIGHTFIT`13 may 2015`C++3301.91999
mikleb`31 dec 2006`C++200.521003
NIGHTFIT`13 may 2015`C++3201.851122
 C++ 24 Kylix 6 Java 2 FPC 1
` >  >  >  >  >  >  >  >  >  > `

## Plane partition.

Time limit = 2 second(s)

You are given many line segments on a plane. Intersection of any two segments can be point or empty set. You have to determine how many "rooms" our plane is divided to.

Input First line contains number of line segments N, 0 < N ≤ 1000. Each of next N lines has four integers Х1, Y1, Х2, Y2 --- coordinates of line segment ends. Absolute values of coordinates does not exceed 100000.

Output Number of rooms.

 Input#1```1 1 1 2 2 ``` Output#1```1 ```
 Input#2```4 0 0 0 1 0 1 1 1 1 1 1 0 1 0 0 0 ``` Output#2```2 ```

Author:
First Moscow Individual Programming Championship, 17 October 2004, MIPT

 © acm.mipt DevGroupThe page was generated in 200ms