//My issue is , for input 3 1000 0 0 i am supposes to get 3000 as output, but i am //getting 2975. please help me figure out whats wrong in my code.

include

using namespace std;

int main() {

// your code goes here

int t; cin>>t;

int sum=0;

while(t–){

int n,x,c; cin>>n>>x;

int m=n-1;

int a[m];

for(int i=0;i<m;i++){

cin>>a[i];

}

for(int i=0;i<m;i++){

sum+=a[i];

}

c=n*x-sum;

cout<<((c<0) ? 0 : c)<<endl;

```
}
return 0;
```

}