BIGINT library for c++. check http://www.codechef.com/problems/EGYPTFRA for practice