Skip to content

Instantly share code, notes, and snippets.

@phannam1412
Last active January 31, 2018 04:22
Show Gist options
  • Save phannam1412/19dc318aba48bf5bac069d5910b64841 to your computer and use it in GitHub Desktop.
Save phannam1412/19dc318aba48bf5bac069d5910b64841 to your computer and use it in GitHub Desktop.
for test
Write it in Python, input from input.txt and output to output.txt
input.txt contains an integer representing the size of the matrix.
output.txt contains the result matrix.
Example input and output:
input.txt: 3
output.txt:
5 6 7
4 9 8
3 2 1
input.txt: 4
output.txt:
7 8 9 10
6 15 16 11
5 14 13 12
4 3 2 1
input.txt: 5
output.txt:
9 10 11 12 13
8 21 22 23 14
7 20 25 24 15
6 19 18 17 16
5 4 3 2 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment