atcoder#ABC225C. [ABC225C] Calendar Validator
[ABC225C] Calendar Validator
Score : points
Problem Statement
There is a matrix , where the -th entry is for every pair of integers .
Given an matrix , determine whether is some (unrotated) rectangular part of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If is some rectangular part of , print Yes
; otherwise, print No
.
2 3
1 2 3
8 9 10
Yes
The given matrix is the top-left submatrix of .
2 1
1
2
No
Although the given matrix would match the top-left submatrix of after rotating degrees, the Problem Statement asks whether is an unrotated part of , so the answer is No
.
10 4
1346 1347 1348 1349
1353 1354 1355 1356
1360 1361 1362 1363
1367 1368 1369 1370
1374 1375 1376 1377
1381 1382 1383 1384
1388 1389 1390 1391
1395 1396 1397 1398
1402 1403 1404 1405
1409 1410 1411 1412
Yes