Solved tile cost problem