/*
* For a giving array of ranges of positive numbers in any size and in any order, find a solution for the following:
*
* 1. externd the ranges if they are contiguous or overlapping.
* 2. then give the output of all distinct non-contiguous ranges
* E.g.:
* Input: (4, 8), (3, 6), (10, 20), (20, 25)
* Output: (3, 8), (10, 25)
*/
using System;
public class Program
{
public static void Main()
(int start, int end)[] ranges = { (1, 2), (2, 10), (2, 5), (8, 13), (7, 17), (20, 23), (17, 20), (25, 30), (40, 50) };
// Solution....
//
Console.WriteLine("Distinct non-contiguous ranges:");
}