我们学校的一道oj题目求助

0XWn39.png
题目如图,我写的代码本地运行样例和自己编的几组数据我都没发现错,但就是一直wa

#include<iostream>

using namespace std;

long long a[3];
int i,n,x=0,t=0;

int main()
{
    ios::sync_with_stdio(false);
    for (i = 0;i < 3;++i)
    {
        cin >> a[i];
    }
    for (i = 0;i < a[0];++i)
    {
        cin >> n;
        n += x;
            if (n > a[1])
            {
                t += n - a[1];
                x += a[2];
            }
    }
    cout << t;
    return 0;
}