Construct an table of positive integers whose diagonal sum is exactly , with all other cells set to $1$.
You are given two integers and . Build an table of positive integers such that:
- the sum of the main diagonal equals exactly ,
- every other cell contains $1$.
If multiple tables are possible, any valid one is acceptable.
This is a straightforward construction problem: the only values you are free to choose are the diagonal cells, while all non-diagonal cells are fixed to $1$.
Input Format
- The first line contains two integers and .
Output Format
- Print an table of positive integers.
- The sum of the diagonal elements must be exactly .
- All off-diagonal elements must be $1$.
Constraints
- All printed values must be positive integers.
If exact original contest limits are unknown, treat the task as requiring a valid constructive output for arbitrary feasible and .
Example 1
Input
3 7
Output
2 1 1 1 2 1 1 1 3
Explanation
The diagonal sum is , and every non-diagonal cell is $1$.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.