Tle comes for 1 test case

pass vector a by reference.

what would be the use of it

That way you do right now whole vector is copied to for every function call so it consumes time. While passing it by reference points to the original one and makes your program efficient.