Imagine that we have the following tiles
12 tiles. Since we are going to cover a square shape using this tiles, we must use the same number of tiles for each side of the square. So, if we use 2 tiles per side we get
which means that we use 4 tiles to build this square. Notice that in here we used 2 tiles per side and ended up using 2*2 = 4 tiles. So we should calculate the biggest number of tiles per side so that we can build a square. Notice that if we use 3 tiles per side, then we use 3*3 = 9 tiles. If we wanted to use 4 tiles per side, we would need 4*4 = 16 tiles. However, we only have 12. So we can build a square of at most 3 tiles per side. Since a 3-tiles-side square uses 9 tiles, we end up with 3 tiles left.