Want to try solving this problem? You can submit your code online if you log in or register.
The summer holidays have just started, but before you can go outside and play, you have to finish all of your maths homework. Your maths teacher insists that you fill out a very specific type of Magic Square. In particular:
Three cells of the magic square have already been filled: the top-left cell, the top-middle cell, and the middle-left cell. You may fill in the remaining squares with any numbers you wish, though your maths teacher prefers some numbers over other numbers. These numbers are explained in the `Subtasks & Constraints' section. You pull out your trusty laptop and get to work!
The first and only line of input will contain three integers: A, B and C.
1 2 3
1 2 -3 3 0 -3 -4 -2 6
1 2 27 3 26 1 26 2 2
1 2 14 3 13 1 13 2 2
The sample input corresponds to the following partially filled magic square:
1 | 2 | ? |
3 | ? | ? |
? | ? | ? |
Output A is a magic square where every row/column adds up to 0. This would be a correct output for subtask 1 only (see below for more information).
Output B is correct for subtasks 1 and 2.
Output C is correct for all subtasks.
For each subtask, you will be awarded marks based on what numbers you use to fill out the magic square. Namely:
Privacy
statement
© Australian Mathematics Trust 2001-2024
Page generated: 4 July 2024, 11:44am AEST