first i submitted using vector (i have done this earlier in other problems successfully ) but got runtime error & same code i submitted using structure(everything was same except i stored the value in struct variable instead of vector ) & … got AC . lol !!
[http://www.codechef.com/viewsolution/3160692] (using vector)
[http://www.codechef.com/viewsolution/3160968] (using structure)