Help me in solving KO_MON problem

My issue

pls help me in finding error in my logic.
i calulated the max nd min element and give the ans = max(d + x * (n - 1), c) why it is wrong?

My code

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

int main() {
    int t;
    cin >> t;
    while (t--) {
        long long n, x;
        cin >> n >> x;
        vector<long long> h(n);
        long long c = LLONG_MIN;
        long long d = LLONG_MAX;
        
        for (int i = 0; i < n; i++) {
            cin >> h[i]; 
            c = max(c, h[i]);
            d = min(d, h[i]);
        }
        
        long long ans = max(d + x * (n - 1), c);
        cout << ans << endl;
    }
    return 0;
}

Problem Link: Monster Monster Practice Coding Problem

refer the test case [1,99,100] where the increment after one day is 10
basically we have to find the max point reached in the array , it is only possible if you compare the last max with the current max , which can be by first sorting and the adding the increment at each index and according to day (day*increment) , and comparing the last max of the with current position;