forked from tanvi1004/competitivesolutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedward.c
37 lines (36 loc) · 759 Bytes
/
edward.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<stdio.h>
void main()
{
int T, N , H, Y1, Y2, L, i1,i2, j, k,count;
scanf("%d",&T);
for(j=0;j<T;j++)
{
scanf("%d %d %d %d %d", &N, &H, &Y1, &Y2, &L);
while(L>0 || N>0)
{
scanf("%d %d",&i1,&i2);
if(i1==1)
{
if(i2>=(H-Y1))
count++;
else
{
count++;
L--;
}
}
if(i1==2)
{
if(i2<Y2)
count++;
else
{
count++;
L--;
}
}
N--;
}
printf("%d \n",count);
}
}