Test instructions
In a corridor of length L, two people stood at the left and right sides of the corridor at the P,q speed, and asked them how far they were from the right side when they met.
Ideas:
Very simple violent problem, not explained.
The code is as follows:
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <fstream>5#include <ctime>6#include <cmath>7#include <cstdlib>8#include <fstream>9 Ten using namespacestd; One A intMain () - { - DoubleL, p, Q;//L represents the length of the corridor, P,q respectively stands at the right and left both sides of the speed the while(SCANF ("%LF%LF%LF", &l, &p, &q) = =3) - { -printf"%lf\n", l/(P+Q) *p);//the length of the point at which the two people meet (starting at the initial position of p to the length of the meeting point) - } + - return 0; +}
Codeforces Round #327 (Div. 2)-wizards ' duel