Maximum Non-overlapping Bridges
easy
1. You are given a number n, representing the number of bridges on a river. 2. You are given n pair of numbers, representing the north bank and south bank co-ordinates of each bridge. 3. You are required to print the count of maximum number of non-overlapping bridges.
Constraints
0 <= n <= 20 0 <= n1n, n1s, n2n, n2s, .. <= 100
Format
Input
A number n .. n pair of number each on a separate line (and pair separated by space)
Output
A number representing the count of maximum number of non-overlapping bridges.
Example
Sample Input
10
10 20
2 7
8 15
17 3
21 40
50 4
41 57
60 80
80 90
1 30
Sample Output
7
Question Video