#include <stdio.h>
#include <omp.h>

#define N 1000000  // Size of the array

int main() {
    int arr[N];
    long long sum = 0;  // The sum of the array elements

    // Initialize the array
    for (int i = 0; i < N; i++) {
        arr[i] = 1;  // Set all elements to 1
    }

    // Parallel region with reduction to compute the sum
    #pragma omp parallel for reduction(+:sum)
    for (int i = 0; i < N; i++) {
        sum += arr[i];
    }

    printf("The sum of the array is: %lld\n", sum);

    return 0;
}
