Russian Doll Envelopes
hard
1. You are given a number n, representing the number of envelopes. 2. You are given n pair of numbers, representing the width and height of each envelope. 3. You are required to print the count of maximum number of envelopes that can be nested inside each other. Note -> Rotation is not allowed.
Constraints
0 <= n <= 20 0 <= n1w, n1h, n2w, n2h, .. <= 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 envelopes that can be nested inside each other.
Example
Sample Input
11
17 5
26 18
25 34
48 84
63 72
42 86
9 55
4 70
21 45
68 76
58 51
Sample Output
5
Question Video