Nyoj 97 兄弟郊游问题
2014-04-29 13:06
351 查看
题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=97
#include <iostream> #include <cstdio> using namespace std; int main() { double k, dis, x, y, z, m; int T; scanf("%d", &T); while(T--) { scanf("%lf %lf %lf %lf", &m, &x, &y, &z); k = (m*x)/(y-x); dis = k * z; printf("%.2lf\n", dis); } return 0; }