char ans[10000];
char* convert(char* s, int numRows) {
int m_size = strlen(s);
if(numRows<=1)return s;
int cyc = 2 * numRows - 2;
int col = m_size/numRows;
int alen = 0;
int k = cyc ;
for(int i = 0 ; i < numRows; i ++)
{
for(int j = 0 ; j <= col; j++)
{
int p = (j * cyc + i);
if(p < m_size)ans[alen++] = s[p];
if(i == 0 || i == numRows-1)continue;
int q = (j * cyc + i + k);
if(q < m_size)ans[alen++] = s[q];
}
k-= 2;
}
ans[alen++] = 0;
return ans;
}