HDU 4946 just a joke (Mathematics + physics)

Source: Internet
Author: User

Link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 4969

Just a joke

Time Limit: 2000/1000 MS (Java/others) memory limit: 131072/131072 K (Java/Others)
Total submission (s): 332 accepted submission (s): 135


Problem descriptionhere is just a joke, and do not take it too seriously.

Guizeyanhua is the president of acmm, and people call him President guizeyanhua. when guizeyanhua is walking on the road, Everyone eyes on him with admiration. recently, guizeyanhua has fallen in love with an unknown girl who runs along the circular race track on the playground every evening. one evening, guizeyanhua stood in the center of the circular race track and stared the girl soulfully again. but this time he decided to catch up with the girl because of his lovesickness. he rushed to the girl and intended to show her his love heart. however, he cocould not run too far since he had taken an arrow in the knee.

Now your task is coming. given the maximum distance guizeyanhua can run, you are asked to check whether he can catch up with the girl. assume that the values of guizeyanhua's and the girl's velocity are both constants, and guizeyanhua, the girl, and the center of the circular race track always form a straight line during the process. note that the girl and guizeyanhua can be considered as two points.

 

 

Inputthe input begins with a line containing an integer T (t <= 100000), which indicates the number of test cases. the following T lines each contain four integers V1, V2, R, and D (0 <V1, V2, R, D <= 10 ^ 9, V1 <= V2 ). v1 is the velocity of the girl. v2 is the velocity of guizeyanhua. R is the radius of the race track. D is the maximum distance President guizeyanhua can run.

 

Outputfor each case, output "Wake up to code" in a line if guizeyanhua can catch up with the girl; otherwise output "Why give up treatment" in a line.

 

Sample input21 1 1 111904 41076 3561

 

Sample outputwhy give up treatmentwake up to code

 

Authorsysu

 

 

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Bytes ------------------------------------------------------------------------------------------------------------

In the ninth multi-school session, this was a problem. Pure physics + pure mathematics means that it is speechless.

The subject refers to a person in the center of the circle who likes to rotate at a uniform speed in the circle. Now he wants to chase the girl and confess to her.

At any time, the center of the circle, both of them are in a straight line, and the man can only walk the distance of D.

.......................................

I don't want to write the problem, here is very detailed: http://blog.csdn.net/u011775691/article/details/38691623

 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <math.h> 5  6 int main() 7 { 8     int T; 9     scanf("%d",&T);10     while(T--)11     {12         double V1,V2,R,D;13         scanf("%lf%lf%lf%lf",&V1,&V2,&R,&D);14         double ans=R/V1*asin(V1/V2);15         if(ans*V2 > D)16         {17             printf("Why give up treatment\n");18         }19         else printf("Wake up to code\n");20     }21     return 0;22 }

 

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.