Problem B

Statement
Copy Copied
Description:
There is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it that

- starts in the upper left cell of the matrix;
- each following cell is to the right or down from the current cell;
- the way ends in the bottom right cell.

Moreover, if we multiply together all the numbers along the way, the result should be the least "round". In other words, it should end in the least possible number of zeros.

Input Format:
The first line contains an integer number n (2 ≤ n ≤ 1000), n is the size of the matrix. Then follow n lines containing the matrix elements (non-negative integer numbers not exceeding 109).

Output Format:
In the first line print the least number of trailing zeros. In the second line print the correspondent way itself.

Note:
None

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
60 20260124-045845 vertex gemini-3-pro-preview go true 2026-01-24T05:49:51.217706Z View View View View Retry