Pass CET 6
题号:NC25350
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 128 M,其他语言256 M
64bit IO Format: %lld

题目描述

Marzz liked a strange way of memorizing words.

 Now these words are placed in an  Matrix. He decided to memorize only one line or one column of words every day. She has memorized days in total, and now she wants to know: for each word, when was the last time she memorized it?

输入描述:

输出描述:

示例1

输入

复制
3 3 3
1 2
2 3
1 3

输出

复制
0 0 2
1 1 2
3 3 3