Young_Prince.fail
C
#include <stdio.h>
int main() {
int cnt; scanf("%d",&cnt);
int arr[3],start = 0, end = 0,twin;
while(cnt){
int x,y,x1,y1;scanf("%d %d %d %d", &x,&y,&x1,&y1);
int num; scanf("%d",&num);
while(num) {
scanf("%d %d %d",&arr[0],&arr[1],&arr[2]);
twin = 0;
if (x<arr[0]+arr[2] && x>arr[0]-arr[2]) {
if (y<arr[1]+arr[2] && y>arr[1]-arr[2]) {
start++; twin++;
}
}
if (x1<arr[0]+arr[2] && x1>arr[0]-arr[2]) {
if (y1<=arr[1]+arr[2] && y1>=arr[1]-arr[2]){
end++;twin++;
}
}
if (twin == 2) {start--;end--;}
printf("%d\n",twin);
num--;
}
printf("%d\n",(start + end));
cnt--;start=0,end=0;
}
return 0;
}
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.