C # program for the above approach
using System ; class GFG { public class pair { public double first , second ; public pair ( double first , double second ) { this . first = first ; this . second = second ; } }