title: Using pow(x,y) in large numbers
body: <p>I am inputting a number n where 1&lt;=n&lt;=10^5. I need a number of length n. So I use pow(10,n-1) but it doesnt work when n=100000. What is the error ?</p>
  
  <p>EDIT: Its codeforces div2 round 152 problem B.</p>
  
  <p>Chilly Willy wants to find the minimum number of length n, such that it is simultaneously divisible by all numbers Willy already knows (2, 3, 5 and 7). Help him with that.</p>
  
  <p>A number's length is the number of digits in its decimal representation without leading zeros.</p>
  
  <p>Input
  A single input line contains a single integer n (1 ≤ n ≤ 10^5).</p>
  
  <p>My code works upto n=19. It fails on pretest 9.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;math.h&gt;
  using namespace std;
  
  int main()
  {
  int f=0;
  unsigned long long n;unsigned long long out;
  cin&gt;&gt;n;
  unsigned long long num=1;unsigned long long lim=10;
  for(unsigned long long z=0;z&lt;n;z++)
  {num=num*10;lim=lim*10;}num=num/10;lim=lim/10;
  for(;num&lt;lim;num++)
  {
  if((num%2==0)&amp;&amp;(num%3==0)&amp;&amp;(num%5==0)&amp;&amp;(num%7==0)){f=1;out=num;break;}
  }
  
  if(f==1){cout&lt;&lt;out;}
  else if(f==0){cout&lt;&lt;"-1";}
  
  return 0;
  }
  </code></pre>