he can arrange the black and white photes in 5 rows because you can make 2 rows of 6 or 6 rows of 2. also you can put 1 rows of 12 or 4 rows of 3 or 3 rows of 4. sam can arrange the color photes in 4 different ways of 18 because he can put 1 row of 18 or 18 rows of 1. Also he can put 2 rows of 9 or 9 rows of 2.
Hope this helps!