#include<bits/stdc++.h>
using namespace std;
namespace Solution
{
double l,w;
int n,T;
struct node
{
double l,r;
}a[15001];
inline bool cmp(node x,node y)
{
return x.l<y.l;
}
inline void read()
{
int m=0;
cin>>n>>l>>w;
for(int i=1; i<=n; i++)
{
double x,y;cin>>x>>y;
if(y<=w/2.00000)continue;
a[++m].l=x*1.00000-sqrt((y*y*1.0000)-(w*w/4.00000));
a[m].r=x*1.00000+sqrt((y*y*1.0000)-(w*w/4.00000));
}
sort(a+1,a+m+1,cmp);n=m;
}
inline int solve()
{
double now=0;
int ans=0,j=1;
while(now<l)
{
ans++;
double x=now;
for(; a[j].l<=x&&j<=n; j++)now=max(now,a[j].r);
if(x==now)return -1;
}
return ans;
}
}
int main()
{
int T;
cin>>T;
while(T--)
{
Solution::read();
cout<<Solution::solve()<<endl;
}
}
标签:node,1.1,10002,int,namespace,Solution,喷水
From: https://www.cnblogs.com/dadidididi/p/16592914.html