Help me in solving AOCV202 problem

My issue

why do we use A[i-1] = i

My code

// Update the '_' in the code below to solve the problem

#include <bits/stdc++.h>
using namespace std;

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N;
	    cin>>N;
	    int A[N];
	    
	    for(int i = 1; i <= N; i++)
	    {
	        A[i-1] = i;
	    }
	    // print the elements of array A
	    for(int i = 0; i < N; i++)
	    {
	        cout << A[i] << " ";
	    }
	    cout << endl;
	    // print the elements of array A in descending order
	    for(int i = N-1; i >= 0; i--)
	    {
	        cout << A[i] << " ";
	    }
	    cout << endl;
	}
}
	   

Learning course: Beginner DSA in C++
Problem Link: CodeChef: Practical coding for everyone

@jbansal359
because we have used array of size N whose indexing will be from 0 till n-1 , that is why we are doing A[i-1] =i. To be in the range of 0 to n-1.