11639 - Guard the Land
Posted: Sun Aug 02, 2009 3:32 pm
Hello everyone,
Can anyone give me some critical test case for this problem?
Can anyone give me some critical test case for this problem?
IT is a easy problem....There is no ticky test case.......
HERE is two test cases..........
try it.......
Code: Select all
2
0 0 1 1
0 1 2 3
0 0 1 1
0 0 1 1
Code: Select all
Night 1: 0 5 9995
Night 2: 1 0 9999
Code: Select all
# include <stdio.h>
# include <math.h>
int main()
{
int x1,x2, x3,x4, y1,y2,y3,y4;
int T,i;
int strongArea, weakArea, unsecuredArea;
int rectA,rectB;
//freopen("e:\\11639.in","r",stdin);
scanf("%d",&T);
for(i=1; i<=T; i++)
{
scanf("%d%d%d%d",&x1,&y1,&x3,&y3);
scanf("%d%d%d%d",&x2,&y2,&x4,&y4);
if( x2>x3 || y2>y3 )
strongArea = 0;
else
strongArea = abs( (x2-x3)*(y2-y3) );
rectA = abs( (x1-x3)*(y1-y3) ) - strongArea;
rectB = abs( (x2-x4)*(y2-y4) ) - strongArea;
weakArea = rectA + rectB;
unsecuredArea = 10000 - ( weakArea + strongArea );
printf("Night %d: %d %d %d\n",i,strongArea,weakArea,unsecuredArea);
}
return 0;
}
input:Hello nazmul
ur code donot pass this case:
try it........
Code: Select all
1
3 3 3 3
1 1 1 1
Code: Select all
Night 1: 0 0 10000
Code: Select all
1
10 10 20 20
15 5 16 26
Code: Select all
Night 1: 10 101 9889
Code: Select all
try this test case :mrmbdctg wrote:Hello everyone,
Can anyone give me some critical test case for this problem?
Code: Select all
9
10 10 20 20
10 10 20 20
10 10 20 20
10 10 20 15
10 10 20 25
10 10 20 20
10 10 20 15
10 10 20 20
10 10 20 20
10 10 20 25
10 10 20 20
15 15 25 25
10 10 20 20
20 20 30 30
10 10 20 20
5 5 9 9
10 10 20 20
15 5 16 26
Code: Select all
Night 1: 100 0 9900
Night 2: 50 50 9900
Night 3: 100 50 9850
Night 4: 50 50 9900
Night 5: 100 50 9850
Night 6: 25 150 9825
Night 7: 0 200 9800
Night 8: 0 116 9884
Night 9: 10 101 9889