#include #include #include #include using namespace std; int main() { int N, M; cin >> N >> M; char op; cin >> op; vector row(N), col(M); for (int i = 0; i < M; i++) { cin >> col[i]; } for (int i = 0; i < N; i++) { cin >> row[i]; } for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { if (op == '+') { cout << row[i] + col[j]; } else { cout << row[i] * col[j]; } if (j != M - 1) { cout << " "; } else { cout << endl; } } } return 0; }