#include #include #include #include constexpr std::size_t MAX_N = 1001; int students_amount, task_per_student, total_days; std::array, MAX_N> arrangements; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cin >> students_amount >> task_per_student >> total_days; for (int _ = 0; _ < students_amount; _++) { for (int i = 0; i < task_per_student; i++) { int day; std::cin >> day; arrangements[day][i] = true; } } bool first = true; for (int i = 1; i <= total_days; i++) { if (!first) { std::cout << ' '; } std::cout << std::count(arrangements[i].begin(), arrangements[i].end(), true); first = false; } std::cout << std::endl; return 0; }