Skip to content

Commit dd2dd20

Browse files
authored
Adding pr.cpp
1 parent 4351816 commit dd2dd20

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pr.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
bool isOverlap(pair<int,int> p1,pair<int,int> p2,pair<int,int> p3,pair<int,int> p4){
5+
if(p1.first>p4.first || p2.first<p3.first) return false;
6+
if(p1.second<p4.second || p2.second>p3.second) return false;
7+
return true;
8+
}
9+
10+
int main(){
11+
int t;
12+
cin>>t;
13+
while(t--){
14+
pair<int,int> p1,p2,p3,p4;
15+
cin>>p1.first>>p1.second;
16+
cin>>p2.first>>p2.second;
17+
cin>>p3.first>>p3.second;
18+
cin>>p4.first>>p4.second;
19+
cout<<isOverlap(p1,p2,p3,p4)<<'\n';
20+
}
21+
return 0;
22+
}

0 commit comments

Comments
 (0)