Algorithm · OpenAI · Easy
You are implementing a core component of a machine learning library: the element‑wise addition of two matrices. This operation forms the backbone of forward passes in linear layers when working with batched inputs. Write a program that reads an integer n — the size of two square matrices — followed by 2n lines, each representing a row of a matrix. The first n lines belong to matrix A, the next n lines to matrix B. Each line contains n space‑separated integers. Your task is…