#chokudai004a. [chokudai004_a]Just Write Numbers!
[chokudai004_a]Just Write Numbers!
Problem Statement
Takahashi loves three integers , , and .
He will write integers in an grid so that it will contain many vertical or horizontal contiguous segments whose sums are his favorite numbers.
For example, if he writes numbers as follows and his favorite number is , the segments painted red have the desired sum.
Let be the number of vertical or horizontal segments whose sums are , respectively. He will then get $A_1 \\times B_1 + A_2 \\times B_2 + A_3 \\times B_3$ points.
However, there are some limitations to what Takahashi can write in the grid. On each square, he must write a number between the lower and upper limits specified for that square.
On the square at the -th row from the top and -th column from the left, he must write a number between and (inclusive).
Find a way to write numbers so that Takahashi gets as many points as possible.
This is a so-called "marathon" problem where you are not assumed to find the optimal solution. Any valid solution will get a score.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Let be the number to write the square at the -th row and -th column. Print your solution in the following format:
Your solution will be considered valid if for every , and will get a score according to the Problem Statement.
If your output is not considered a valid solution, it will get points in almost all test cases.
Input Generation
- will be generated uniformly at random within the range specified in Constraints.
- and will be generated uniformly at random between and (inclusive), independently for each square. If gets greater than , they will be swapped.