forked from VibhutiJindal/CodeChef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPIPSQUIK
49 lines (35 loc) · 886 Bytes
/
PIPSQUIK
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
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
int k=0;
cin>>k;
while(k--)
{
int n,h,y1,y2,l,count=0;
cin>>n>>h>>y1>>y2>>l;
while(n--)
{
int t,x;
cin>>t>>x;
if(((t==1) && ((h-y1)<=x) ) || ((t==2) && (y2>=x)))
{
if(l<=0)
continue;
else
count++;
}
else
{
l--;
if(l<=0)
continue;
else
count++;
}
}
cout<<count<<endl;
}
return 0;
}