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 <bits/stdc++.h> | |
#define SZ(X) ((int)(X).size()) | |
#define ALL(X) (X).begin(), (X).end() | |
#define REP(I, N) for (int I = 0; I < (N); ++I) | |
#define REPP(I, A, B) for (int I = (A); I < (B); ++I) | |
#define REPP_(I, A, B) for (int I = (A); I >= (B); --I) | |
#define I(X) cin>>X | |
#define II(X, Y) cin>>X>>Y | |
#define III(X, Y, Z) cin>>X>>Y>>Z | |
#define MP make_pair |
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.*/ |