Problem2171--Stable Arrangement of Rooks

2171: Stable Arrangement of Rooks

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Sample Input Copy

5
3 2
3 3
1 1
5 2
40 33

Sample Output Copy

..R
...
R..
-1
R
.....
R....
.....
....R
.....
-1

Source/Category