The common factors of 300 and 520 are 1, 2, 5, 10 and 20, therefore the biggest square tile must be 20 x 20.
300 into 20 goes 15 times, 520 into 20 goes 26 times, so you need 26 tiles wide by 15 tall gives 390 tiles in total.
Packs of 20 means you need 20 packs giving 400 tiles, so 10 left over.
315=3^x X 5^y X 7^z
3 to the power 6 is greater than 315 so x is between 1 and 5.
5 to the power 4 > 315 so y between 1 and 3.
7 to the power 3 > 315 so z between 1 and 2.
Basically x = 2, y=1, z=1 gives 315