title: Find the modulo of division of very big numbers
body: <p>I have to find the modulo of division of this numbers:</p>
  
  <p>239^(10^9) and 10^9 + 13</p>
  
  <p>239^(10^9) and 10^9 + 15</p>
  
  <p>... etc up to 1001;</p>
  
  <p>Using only native libraries in c++. How to do that? As you can see, the first number is about 3 billion symbols.</p>
  
  <p>I tried finding the length of modulo periods, but they are mush longer, than 10, and even <code>unsigned long long int</code> can't deal with such big numbers (239^10). Also I think that "big numbers" algorithms (storing a number as an array) will not work for me too (500*10^9) is too much operations.</p>
  
  <p>BTW, this is supposed to work less, than in 5 hours.</p>