I'm not clear what the above code has to do with diagonal arrays; ID looks like a simple array to me.
How about something like:
for (int i=1; i<=3*(x+2); i++) ID[i]=(i-1)*m+1;
Don't forget C++ arrays are zero based so SUITABLE_LIMIT must be at least the maximum value of 3*(x+2) PLUS ONE. Also the above loop doesn't initialise ID; watch out for that one, maybe use an array name that indicates it's 1-based rather than zero based, something along the lines of Hungarian Notation but simpler, e.g int ID_nz[..], nz meaning "no zero element". I always end up confusing myself if I use some arrays that are zero based and some that are not, in the same program.