Solve UVa 10364 - Square