C # code for above approach
using System ; using System . Collections . Generic ; class GFG { class pair { public float first , second ; public pair ( float first , float second ) { this . first = first ; this . second = second ; } }