#include<stdio.h>

#include<math.h>

#include<string.h>

double first(double vx,double vy,double h) {

    return vx*(vy+sqrt(vy*vy+19.6*h))/9.8;

}

double nowh(double h,double vy,double t) {

    return h+vy*t-4.9*t*t;

}

int main() {

    double  k,h,vx,vy,v1,v2,v3,h1,h2,t;

    char s[30];

    while(scanf("%lf%s",&h,s)!=EOF) {

        if(strcmp(s,"Red")==0) {

            scanf("%lf%lf",&vx,&vy);

            printf("%.3f\n",first(vx,vy,h));

            continue;

        }

            if(strcmp(s,"Yellow")==0) {

            scanf("%lf%lf%lf",&vx,&vy,&t);

          if(first(vx,vy,h)<vx*t) {

             printf("%.3f\n",first(vx,vy,h));

             continue;

    }

        h1=nowh(h,vy,t);

        h2=vx*t;

        vy=vy-9.8*t;

        printf("%.3f\n",h2+first(2*vx,2*vy,h1));

        continue;

            }

            if(strcmp(s,"Blue")==0){

                scanf("%lf%lf%lf%lf%lf%lf",&vx,&vy,&t,&v1,&v2,&v3);

                if(first(vx,vy,h)<vx*t) {

                printf("%.3f\n",first(vx,vy,h));

                continue;

                }

                 h1=nowh(h,vy,t);

                 h2=vx*t;

                 vy=vy-9.8*t;

    printf("%.3f %.3f %.3f\n",h2+first(v1,vy,h1),h2+first(v2,vy,h1),h2+first(v3,vy,h1));

            }

    }

    return 0;

}

//一个博客地址帮助你理解http://blog.sina.com.cn/s/blog_c0519a300101dr2w.html

最新文章

  1. VS的安装
  2. [已解决] java.net.ConnectException: Connection refused: no further information
  3. 连接ssql语句
  4. 将java的class文件放到一个指定文件夹下
  5. coffeeScript 语法总结
  6. Oracle index hint syntax
  7. windows防火墙无法启动,服务不存在
  8. 基于memcached中命令分析函数tokenize_command改造的split函数
  9. 启动Activity,传递参数最佳实践
  10. Python作用域
  11. springMVC在普通方法中调用service方法
  12. WIN7下安装SVNserver端及client搭建协作环境
  13. 聊聊 JUC 并发包
  14. codeforces#552 D. Vanya and Triangles(几何)
  15. js 正则表达式的使用(标志 RegExp exec() test() compile() $1...$9)
  16. 实验吧 这个看起来有点简单!&amp;渗透测试工具sqlmap基础教程
  17. 针对后台TCP服务F5健康检查配置
  18. CentOS7.3安装mysql数据库
  19. 【CS231N】2、多类SVM
  20. 浅议Github的注册和使用

热门文章

  1. 在nginx上部署vue项目(history模式)--demo实列;
  2. 降低winnt Apache服务的权限,让你的虚拟主机更安全
  3. Windows下降权MYSQL和apche的运行级别(普通用户权限运行)
  4. IIS6配置FastCGI遇到ERROR5的解决方法
  5. AJPFX关于Java内部类及其实例化
  6. LN : leetcode 684 Redundant Connection
  7. # Transition:添加弹出过渡效果
  8. Architecture:架构 元素与关系
  9. Android Studio集成crashlytics后无法编译的问题
  10. Exploded location overlaps an existing deployment解决办法