Accessing pair elements

How can I access the first element of a pair if that pair lies at the ith index in an array?

if arr[i] is pair then for getting first element you can use
arr[i].first

@somesh.ps do you have any further doubts?

My code still throws an error with arr[i].first

https://codeshare.io/50DBWv

the problem is that
arr[i] is not pair
arr is of type int not pair<int,int>

so instead of int arr[N];
use pair<int ,int> arr[N];

/bin/run.sh: line 4: 18 Bus error (core dumped) ./exe

now the code shows this error https://codeshare.io/5oAm1b