Friend Paring Problem

https://ide.codingblocks.com/s/191083 here is my code…
My doubt is when i run my code for the t test cases it gives the wrong the output…for a single test case its working fine…! Please have a look at my code…i am little bit confused…i think there may be problem when i am storing my answers in a vector…some recurive stack problem!!

@archa_1712
hello Yogendra,
In line no 27 , u are printing ans but actually u should print v[i]

My Bad!!..but stil…now after replacing with v[i] …my test cases are not passing

@archa_1712
change vector datatype to long long

Yeah it worked!!..but why is it so??..why it need to be long long??

@archa_1712
answer can be bigger than the range of int thats why use long long

okay! Thanks:grinning::grinning::grinning::grinning::grinning: