Always read the statement
1, 2, 3, ..., n
1, n+1, 2n+1, ..., (m-1)*n+1
I have even written a testing program to verify this and it reports that there is no mistake. I checked this on a few inputs like (2, 3), (1, 50), (50, 1), (50, 50) and it always seems to be correct. Can anybody give me a hint on where my mistake is?
UPD:
Got AC after changing to this:
1, 2, 3, ..., n
n+1, 2n+1, ..., m*n+1
The question remains. WTF?
UPD2:
Read the statement again and figured this out. All number should be different. In my solution, 1 was repeated twice.
Edited by author 26.11.2011 22:13