I don't know how to name this question more properly, but this is it, basically:

I've made a pair `pair<int, int> P[20000]` and I'm using `P.first` and `P.second` but...

When I try to input into P.first, like `cin >> P.first[i]` (i is the counter) it doesn't let me. It calls an error when compiling. How do I fix this?

Edit: Got the answer to my previous question, but new question: I'm trying to run a descending sort on P.second like so

```
sort(P.second, P.second + x, greater<int>());

```

but it causes another compilation error. I understand why this happens, but how do I fix it. Basically, say that the pairs are `{{0,0}, {3,2}, {4,-1}, {5,1}}` my desired result is `{{3,2}, {5,1}, {0,0}, {4,-1}}`.

How would I go about doing this?