thanks a lot, nihil.
That should work for all my local computation needs. But, that brings me to another question. You must've seen the online coding contests where you submit your code to the online compiler and get results instantly. I can't use any extra libraries in that case and I've always wondered how those working in C++ manage to handle those large numbers with built-in data types.

PS: I could've worked the problems out on python, but speed is a major factor.