Raising integers to high powers
<p>Please help me with the steps to solve this programming problem on SPOJ: <a href="http://www.spoj.com/SPOJ/problems/CSQUARE/" rel="nofollow">7683. Powered and Squared</a>.</p>

<p>The problem calls for raising integers to very high powers - up to 10^120. The power to which an integer is to be raised is expressed as a 250-digit number in base 3. A trivial algorithm times out, because the number of multiplications is insanely high. Is there a better approach?</p>
