C # implementation of the above approach
using System ; class GFG { class pair { public int first , second ; public pair ( int first , int second ) { this . first = first ; this . second = second ; } } static readonly int seg_max = 51 ;