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>
typedef struct n_orthotope
{
	int s[15],e[15];
}N_orthotope;
N_orthotope A,B;
int N,Cnt;
void check(int s1,int e1,int s2,int e2)
{
	if(s1==e2 || s2==e1)Cnt=Cnt;
	else if(s1<=s2 && e1<=e2)Cnt++;
	else if(s1<=s2 && e2<=e1)Cnt++;
	else if(s2<=s1 && e2<=e1)Cnt++;
	else if(s2<=s1 && e1<=e2)Cnt++;
	else Cnt=-1;
	
}
int main()
{
	int i;
	scanf("%d",&N);
	for(i=1;i<=N;i++)scanf("%d %d",&A.s[i],&A.e[i]);
	for(i=1;i<=N;i++)scanf("%d %d",&B.s[i],&B.e[i]);
	for(i=1;i<=N;i++){
		check(A.s[i],A.e[i],B.s[i],B.e[i]);
		if(Cnt==-1)break;
	}
	printf("%d\n",Cnt);
	return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |