Oxymoron#4376

Oxymoron

1 saniye
122,486 megabayt
Orta

Three square matrices of the same size are provided. Your task is to determine if the third matrix is the result of multiplying the first matrix by the second matrix, in that specific order.

Giriş

The input consists of multiple test cases. Each test case starts with an integer (1 \leq n \leq 500), which represents the size of the matrices. This is followed by the details of three matrices, each consisting of rows with integers per row. All integers in the input are no greater than 10^9 by absolute value. The input concludes with a test case where n = 0, which should not be processed.

Çıktı

For each test case, output YES if the third matrix is the product of the first and second matrices. Otherwise, output NO.

Örnekler

Örnek 1

Loading
Loading