You are given a network a comprising of positive integers. It has n lines and m segments. Build a lattice b comprising of positive integers. It ought to have a similar size as a, and the accompanying conditions ought to be met:
Correct answer will be upvoted else downvoted. Computer science.
You are given a network a comprising of positive integers. It has n lines and m segments.
Build a lattice b comprising of positive integers. It ought to have a similar size as a, and the accompanying conditions ought to be met:
1≤bi,j≤106;
bi,j is a numerous of
the outright worth of the contrast between numbers in any adjoining pair of cells (two cells that share a similar side) in b is equivalent to k4 for some integer k≥1 (k isn't really something similar for all sets, it is own for each pair).
We can show that the appropriate response consistently exists.
Input
The primary line contains two integers n and m (2≤n,m≤500).
Every one of the accompanying n lines contains m integers. The j-th integer in the I-th line is ai,j (1≤ai,j≤16).
Output
The output ought to contain n lines each containing m integers. The j-th integer in the I-th line ought to be bi,j.
Step by step
Solved in 4 steps with 1 images