Created
September 26, 2016 13:05
-
-
Save NehaJeevan/0f519381b3b6a64429331a0c334c8452 to your computer and use it in GitHub Desktop.
591 A Codeforces Round #327 (Div. 2), problem: (A) Wizards' Duel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
typedef long long ll; | |
int main() { | |
// your code goes here | |
ll l,p,q; | |
cin>>l>>p>>q; | |
/* If H travels x & his speed is p, V travels l-x with speed q. | |
For collision time taken to travel x & l-x respectively is equal | |
Use equations of motion & calculate x.*/ | |
cout<<(float)(p*l)/(p+q); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, are u a IOS Developer ??