uva 10387 - Billiard

【Agora 本地录制最全总结- 基于Java SDK】 Agora 本地服务端录制 阅读详情

Problem A: Billiard

In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point from which it was launched, after having made m bounces off the vertical sides and n bounces off the horizontal sides of the table. Find the launching angle A (measured from the horizontal), which will be between 0 and 90 degrees inclusive, and the initial velocity of the ball.

Assume that the collisions with a side are elastic (no energy loss), and thus the velocity component of the ball parallel to each side remains unchanged. Also, assume the ball has a radius of zero. Remember that, unlike pool tables, billiard tables have no pockets.

Input

Input consists of a sequence of lines, each containing five nonnegative integers separated by whitespace. The five numbers are: a, b, s, m, and n, respectively. All numbers are positive integers not greater than 10000.

Input is terminated by a line containing five zeroes.

Output

For each input line except the last, output a line containing two real numbers (accurate to two decimal places) separated by a single space. The first number is the measure of the angle A in degrees and the second is the velocity of the ball measured in inches per second, according to the description above.

Sample Input

100 100 1 1 1
200 100 5 3 4
201 132 48 1900 156
0 0 0 0 0

Sample Output

45.00 141.42
33.69 144.22
3.09 7967.81


============================


a*m为水平方向走过的距离,b*n为竖直方向走过的距离,勾股定理得到的斜边即为总路程

除以时间s得到初速度v,角度tan(angle)=(b*n)/(a*m)

atan得到的是弧度数而不是角度数需要转换


#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>

using namespace std;

const double pi=acos(-1.0);

int main()
{
    double a,b,s,m,n,v,angle;
    while(~scanf("%lf%lf%lf%lf%lf",&a,&b,&s,&m,&n))
    {
        if(a==0&&b==0&&s==0&&m==0&&n==0)
            break;
        v=sqrt((a*m)*(a*m)+(b*n)*(b*n))/s;
        angle=atan(b*n/(a*m))/pi*180;
        printf("%.2lf %.2lf\n",angle,v);
    }
    return 0;
}


RK3588平台开发系列讲解(硬件篇-功能外设2) RK3588 芯片内置两个USB3.0 OTG控制器(内嵌2个USB2.0 OTG,下图绿色处),1个USB3.0 HOST 控制器,2个USB2.0 HOST控制器。这些控制器与PHY的内部复用图如下:USB3.0 OTG0 控制器支持SS/HS/FS/LS, 内嵌的USB2.0(HS/FS/LS)信号采用USB2.0 OTG PHY, 信号名见下图的红色方框内;RK3588目前仅此接口支持做Fireware的Download,应用中请务必要预留出。 阅读详情

相关推荐

从mseed到SAC格式转换全攻略:mseed2sac工具安装与批量处理技巧

本文详细介绍了如何将mseed格式的地震数据高效转换为SAC格式,涵盖mseed2sac工具的安装、单文件转换技巧、批量处理自动化实现以及元数据高级处理策略。通过具体命令和脚本示例,帮助地震学研究者快速掌握数据预处理的关键技术,提升波形数据分析效率。

ruby5的博客 927

UVa 10387 - Billiard

Problem A: Billiard In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point

ACM2272902662的专栏 941

椭圆 —— 从理论推导到最小二乘法拟合

前言 椭圆在高中数学里就开始提到,都是从标准方程开始如: x2a2+y2b2=1(a>b>0) \frac{x^2}{a^2}+\frac{y^2}{b^2}=1(a>b>0) a2x2​+b2y2​=1(a>b>0) 其中 aaa 为椭圆的长轴,bbb 为椭圆短轴。如长轴为 111 ,短轴为 0.50.50.5 的椭圆可以这样画出 ezplot('x^2/1^2 + y^2/0.5^2 = 1',[-1.5 1.5 -1 1]) grid on; 标准方程可以很方便

学徒浩子 2万+

10387 - Billiard

Problem A: Billiard In a billiard table with horizontal side a inches and vertical sideb inches, a ball is launched from the middle of the table. Afters > 0 seconds the ball returns to the point from

Fourth Dimension 933

基于FPGA的 SelectIO IP核 的仿真验证-----( LVDS差分高速传输)

SelectIO IP核 的仿真验证

qq_43618170的博客 1万+

Synopsys的CoreConsultant使用简析

CoreConsultant使用简析

weixin_58165606的博客 1万+

TOJ 2353: Billiard

数学?计算几何?物理?这个还是很轻松的。 353: Billiard Time Limit(Common/Java):1000MS/10000MS Memory Limit:65536KByteTotal Submit: 9 Accepted:4 Description In a billiard table with horizontal s...

weixin_34354945的博客 187

【WiFi软件开发】IOCTL和Netlink----用户空间和内核空间交互的两种方式

linux开发中通常会涉及用户空间和内核模块的交互。本文介绍了两种典型的用户空间和内核模块通信方式:ioctl和netlink

liuwe1ye的博客 2348

uva 10387 Billiard(平面几何)

Billiard In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point from wh

不慌不忙、不急不躁 1592

Autoware1.14-摄像头目标检测YOLO-V3

在Autoware1.14中部署YOLOV3

weixin_43687753的博客 3139

【人工智能时代】-什么是MCP?本地如何开发MCP Server

MCP(Model Context Protocol)全称模型上下文协议,是由 Anthropic 推出的一种开放标准,旨在统一大型语言模型(LLM)与外部数据源和工具之间的通信协议。掌握更多的信息控制更多的工具在没有联网搜索之前,大模型的数据来源只有训练数据的时候以及推理我们告诉他的东西。所以后来的rag、知识库都是让AI掌握更多的信息,而MCP的出现是为了让大模型控制更多的工具,赋予更多能力。在本篇文章中,基于 Python 完成了一个简单的 MCP Server 的开发。

xiaoli8748的专栏 1991

UVA - 10387 Billiard

In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point from which it was lau

七夜 574

【DRAM存储器六十六】DDR5介绍--训练相关之CA/CS Training

详述DDR5 CA/CS training过程细节

highman110的博客 198

UVa 10387 - Billiard

传送门UVa 10387 - Billiard

一只冰熊 844

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

UVA-10387 Billiard

2016.09.12 UVA - 10387 Billiard 题目大意:球在桌中心与水平线成一个角度发射,最后返回出发点,给出水平边长度、竖直边长度、飞行时间、竖直边被碰撞次数、水平边被碰撞次数,求发射角度和速度。 解题思路:因为会回到中心,每碰撞一次竖直边,表示最终会在水平上移动完整的水平边长度。竖直同理。知道它总的水平和竖直移动长度,就可以求出实际的路线长度。水

振丿Love 480

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

UVa 10387- Billiard

UVa 10387- Billiard Table of Contents 1 题目 2 思路 3 代码 4 参考 1题目 ============= Problem A: Billiard In a billiard table with horizontal sideainches and vertical sidebinches, a ba...

jishublog 305

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

UVA - 10387 Billiard

UVA - 10387 Billiard题目大意:给出一个长方形的 长和宽, 在长方形的中间有一个球 该球以 一个角度和出速度 射出 给出 运动时间s 和碰到 长 宽 反弹的次数 求初速度 和 角度 解题思路:长方形的每次反弹角度相同 ,每次反弹即 走了 一次 宽或长 所有总路程就是 对应的反弹次数乘以 长或宽, 角度 就是总长比总宽 #include <cstdio> #includ

cwb15505905513的博客 230

uva 10387 Billiard

uva 10387 Billiard 题目大意:有一个长为a宽为b的桌子,现在在桌子的中心放一小球,开始时小球的速度与水平方向有一个夹角,小球在s时间内在水平方向上与桌子相撞了n次,在垂直方向上与桌子相撞了m次,现在要求小球与水平方向所成的角度和速度大小。 解题思路:分解球的运动路线,分解为水平的和垂直的,每碰撞一次水平(垂直),在水平(垂直)上就移动了a(b)。所以运动的总路程为 s

总有那么一群人喜欢盯着我的博客看,估计这是他们见过最长的博客名,我必须得告诉他们博客名最长可以写多长 629

UVA 10387 Billiard

UVA-10387题意:给了5个数据,分别为 水平边高度、竖直边高度、飞行时间、竖直边被碰撞次数、水平边被碰撞次数。把球从中心释放,经过给定时间和碰撞之后正好回到中心,求球的初始角度和速度。 解题思路:因为会回到中心,每碰撞一次竖直边,表示最终会在水平上移动完整的水平边长度。竖直同理。知道它总的水平和竖直移动长度,就可以求出实际的路线长度 l。除以时间就是速度。角度就利用反三角函数求。因为出来的是

QzNarsh的博客 381

UVa 10387 Billiard

思路:可以发现走过的总的水平距离为与垂直边碰撞的次数乘以水平边的长度,即:(a * m),同理总的垂直距离为(b * n)。所以,其弧度为 (a*m)/(b*n) 的反正切值,再转换为角度,总长度用勾股定理算出来再除以时间,就是速度。 #include #include #include using namespace std; double pi = 3.1415926; int ma

围巾的ACM博客 718

Uva 10387 Billiard

题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1328 题目:有一张台球桌水平边长a,竖直边长b,一个台球在其中心,从与水平边夹角为A的以速度v出发,经过时间s,与水平边碰撞反弹m次,与竖直边碰撞反弹n次,最后又经过出发点。已知a,b,s,n

Keaper的博客 400

uva 10387 Billiard 几何 撞球

题意:在一个长宽已知的长方形中心放球,按一定的角度和速度开始运动,走了s时间后回到原处,告诉你长宽分别被撞过几次,求初始速度和角度。 画图可以发现,由于这是个长方形,行走的轨迹水平夹角都是一样的,所以可以知道走过的总长和总宽,路程即斜边,这样,角度和初速度都可以知道了。 代码: #include #include using namespace std; const double pi

水果君の日常 1625

UVA10387 Billiard

Description In a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point from w

潜水的程序猿 733

uva 10387 - Billiard

题意:  台球从水平长度a垂直长度b的桌子中间以速度v射出   s 秒后撞击 水平挡板n次    垂直挡板m次  然后返回出发点 这道题有一个很重要的思想 :   既然速度不变 那么我们就把台球抽象在一个很多的台球桌拼接在一起的平面上的运动    为什么这样想呢  因为入射角等于反射角  然后从一个台球桌的中点到另外一个台球桌的中点找一条满足与垂直相交m次   与水平相交n次的点   找到哪个

泪无痕 540
上一篇: uva 375 - Inscribed Circles and Isosceles Triangles
下一篇: int,long,long long,float,double范围
coco430
博客等级 码龄14年 9粉丝 107原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值