SEGMENTS  Segments
There are N horizontal line segments in the plane. The ith segment has some height h_{i} (which may be negative) and runs from x = a_{i} to x = b_{i} (a_{i} < b_{i}). Segments do not contain their endpoints. You must draw a set of vertical lines (note lines and not line segments) so that every given horizontal segment is intersected at least once and at most R times by vertical lines in such a way that R is minimized.
Input
The first line of the input is N (1 ≤ N ≤ 400), the number of horizontal line segments. N lines then follow, where the ith line is "a_{i} b_{i} h_{i}". Each of a_{i},b_{i},h_{i} are 32bit signed integers. Horizontal segments may overlap.
Output
Your output should consist of a single integer, the smallest value of R that is achievable, followed by a newline.
Example
Input: 3 0 1 5 0 2 2 1 2 7 Output: 2
hide comments
Jelani Nelson (Minilek):
20110615 17:09:50
Yes, that's what it means. 

:D:
20110104 14:18:34
It probably means that segment's 'y' coordinate is equal to 'h' Last edit: 20110104 14:21:17 

cjtoribio:
20101030 20:11:59
WHat does the height refers to ? 
Added by:  Minilek 
Date:  20080110 
Time limit:  1.524s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  MIT 1st Team Contest 2007 