Help needed in problem FFC219B

Question link ->
This is the question from yesterdays contest. My code is giving correct output for all test cases but showing WA pls help…
Heres my code

Do vec[i]=(vec[i-1]+k)%mod;
And try

i tried that too still WA:(

It’s giving “SIGSEGV”

I just edited your code and it got submitted
The link of the edited code is-

The only changes are with the lines -

I don’t know the reason as I don’t code in C++.
Maybe someone else will be able to tell the same.
Hope this helps!!

yeah it did lol…thanks but those lines are only for fast io strange -_-

since you are using fast IO all the inputs and outputs should be taken or given after including fast IO lines.
Since you have used (cin>>t) above the fast io this will lead to ambiguity.
try submitting your code where cin>>t; is placed after fast IO