Equal Rectangles

easy
<a href="https://codeforces.com/problemset/problem/1203/B" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Equal Rectangles</i></a>

Input Format

check the link

Output Format

check the link

Constraints

check the link

Example

Input
5
1
1 1 10 10
2
10 5 2 10 1 1 2 5
2
10 5 1 10 5 1 1 1
2
1 1 1 1 1 1 1 1
1
10000 10000 10000 10000
Output
YES
YES
NO
YES
YES
Previous
Domino
Next
Cells Not Under Attack

Related Questions