title: pattern drawing programming logic
body: <p>I dont remember where the question is from.. but i came through the following :</p>
  
  <p>if user intputs 3</p>
  
  <p>the output should be :</p>
  
  <pre><code>1*2*3*10*11*12
  --4*5*8*9--
  ----6*7----
  </code></pre>
  
  <p>if 5</p>
  
  <p>then,</p>
  
  <pre><code>1*2*3*4*5*26*27*28*29*30
  --6*7*8*9*22*23*24*25--
  ----10*11*12*19*20*21----
  ------13*14*17*18------
  --------15*16--------
  </code></pre>
  
  <p>as you can see we are printing numbers from top to down then again going from down to top..
  we can not use any formatting type functions  as we have <code>setw()</code> in c++.</p>
  
  <p>can you give any algo / logic for the same..
  thanks..</p>