#include <map>
#include <set>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <time.h>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <cstdlib>
#include <limits.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define LL long long
#define PI acos(-1.0)
#define N 1005
#define MAX INT_MAX
#define MIN INT_MIN
#define eps 1e-8
#define FRE freopen("a.txt","r",stdin)
#define G 20
struct peak{
double x;
double y;
}p[N];
int main(){
int t;
scanf("%d",&t);
int ca=1;
while(t--){
int n,m;
double w;
scanf("%d%d%lf",&n,&m,&w);
int i,j,k;
double tmp,v1=0;
double v2=0;
for(i=1;i<=n;i++){
scanf("%lf%lf",&p[i].x,&p[i].y);
if(p[i].y<=p[1].y)tmp=0;
else
tmp=sqrt( 2*G *(p[i].y-p[1].y) );
if(tmp>v1)v1=tmp;
}
while(m--){
double ww;
double h;
double bx,bv;
scanf("%lf%lf%lf",&bx,&bv,&ww);
//bx+=p[1].x;//p[1].x肯定为0
for(j=1;j<n;j++){
if(p[j].x<=bx && bx<=p[j+1].x){
h=(p[j+1].y-p[j].y)/(p[j+1].x-p[j].x)*(bx-p[j].x)+p[j].y;
break;
}
}
double tmp=sqrt(2*G*(h-p[1].y)+bv*bv);
if(tmp>v2)v2=tmp;
}
if(v1>v2)printf("Case %d: %.2f\n",ca++,v1);
else{
printf("Case %d: %.2f\n",ca++,v2);
}
}
return 0;
}
【物理】hdu 4036
最新推荐文章于 2019-08-10 13:09:13 发布