>iMas=new int(m);
You need to use square brackets instead of parens:
iMas=new int[m];
>for (int i=1; i<=m; i++)
Arrays are zero-based in C++. That means you start at 0 and stop at n - 1 or you'll be accessing memory that you're not allowed to access:
for (int i=0; i<m; i++)