This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
int n, w[12][4], i, C;
int main()
{
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d%d", &w[i][0], &w[i][1]);
}
for (i = 0; i < n; i++){
scanf("%d%d", &w[i][2], &w[i][3]);
}
for (i = 0; i < n; i++){
if (w[i][1] < w[i][2] || w[i][3] < w[i][0])break;
if (w[i][1] != w[i][2] && w[i][3] != w[i][0]) C++;
}
if (i != n)printf("-1\n");
else printf("%d\n", C);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |