A physics problem

Source: Internet
Author: User

I haven't been to pits for a long time. "Hand cover Face Bear"

The cheerleading physics exam is finally over.

So Shupo physics problem ... See! Under Surface! ↓

Escape (Escape)
Description

The poor river is trapped in the center of a positive N-shape. and the N-demon that chased it exists at each vertex of the N-side shape. Mountain Demon in accordance with the clockwise direction, with 1~n marking, because the mountain demon is very silly, so each mountain demon I will i+1 to a fixed rate of the mountain demon Move, moving direction will change with the i+1 position changes (N Mountain demon to 1th Mountain demon), eventually all the mountain demon will reach the center of N-shape, that is, the position of river, Complete the hunt. So the river wants to know how much time it takes for the last mountain demon to reach the center in order to find a chance to escape.
Input is a row of three integer n,a,v, representing the number of sides of the regular polygon, the length of the side of the polygon, and the speed at which each clone moves.
Output A real number that indicates the last time a mountain demon reaches the center and retains 5 digits after the decimal point.
Sample Input 1
3 10 5
Sample Output 1
1.33333
Sample Input 2
4 20 8
Sample Output 2
2.50000
Data limitation
20% of data, n<=4, and Answers <=1000;
Data,n<=20; for 70%
100% of the data, n<=300,a<=400000,v<=10000, and the answer <=10000000.

The first eye is not very understanding the topic, anyway, I was like this

Then after a few eyes read the topic.

One thing is for sure, the N monsters are equivalent, in other words, are at the same time to the end

YY the trajectory of any one, probably a circle of things, like this ↓

It's not a very good qaq, but that's basically what it means.

YY again, found that part of the points and no meaning, totally do not know how to fight violence

And then you can find something strange by drawing.

The time to reach the center is when all the dots meet.

, we analyze the two adjacent points. The moving direction of a and B about the AB segment orthogonal decomposition, AB close to each other speed can be divided into two parts, one is divided into a near speed, that is a original speed, and the other part of B away from the speed, that is, B*cos (a) speed (A and B speed angle). and B decomposition of another on the line AB vertical speed, for we have to consider the problem has no effect, only affect the deflection angle, so no analysis value, directly ignored. Because the topic has given the number of edges, the angle between the speed can be sought out.

The question is transformed into a simple chase problem.

So ans=a/(1-cos (2*π/n))/V

Put on a noble code ↓

#include <cstdio>#include<cstdlib>#include<cmath>#definePI ACOs (-1.0)using namespacestd;inta,n,v;DoubleR,dv,sita;intMain () {Freopen ("escape.in","R", stdin); Freopen ("Escape.out","W", stdout); scanf ("%d%d%d",&n,&a,&v); Sita=2*pi/N; R=(Double) A/2/sin (sita/2); DV=(Double) V*sin (sita/2); printf ("%.5lf\n", r/DV); return 0;}

Then, just fine!

"There is a loophole in writing, welcome to pass the great God Spit trough"

2016-09-12 23:45:50

Ending.

A physics problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.