Problem A. Small Addition
Statement
You are to write a problem that reads two positive integers A and B with no more
then five decimal digits and outputs their sum A+B.
Input file format
First line of input file contains two integers A and B.
Output file format
Output file must contain a single integer C = A+B.
Constraints
-10000 <= A, B <= 10000
Sample tests
No. |
Input file (input.txt ) |
Output file (output.txt ) |
1 |
3 5
|
8
|
Problem B. Matrix detour: Spiral
Statement
Your program must fill the
N by
N square matrix
with integers from 1 to
N2; in the following way:
- 1 must be in the top left corner;
- increasing seqeunce of numbers must form a spiral, twisted clockwise and inside.
Input file format
Input file contains an integer
N.
Output file format
Output file must contain the filled matrix as
N lines consisting of
N integers each.
Constraints
1 <=
N <= 100
Sample tests
No. |
Input file (input.txt ) |
Output file (output.txt ) |
1 |
2
|
1 2
4 3
|
2 |
3
|
1 2 3
8 9 4
7 6 5
|