Help me in solving ARRAYARR1 problem

My issue

How can I rearrange this Please soneone help me for it .

Learning course: Arrays using C++
Problem Link: CodeChef: Practical coding for everyone

@shubhammishrao
U have to do it like this.

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

int T, N, X, A[101], B[101];

int main() {
    cin >> T;
    while(T--)
    {
        cin >> N >> X;
        for(int i = 1; i <= N; i++)
            cin >> A[i];
        for(int i = 1; i <= N; i++)
            cin >> B[i];
        int cost = 0;
        for(int i = 1; i <= N; i++)
        {
            if(A[i] >= X)
                cost = cost + B[i];
        }
        cout << cost << endl;
    }
    return 0;
}