题目链接:http://codeforces.com/contest/667/problem/A
题意:一个杯子里有水,一个人在喝并且同时在往里倒。问这个人能不能喝完,多久能喝完。
把相关变量都量化成高度来做简单。
1 /* 2 ┓┏┓┏┓┃キリキリ♂ mind! 3 ┛┗┛┗┛┃\○/ 4 ┓┏┓┏┓┃ / 5 ┛┗┛┗┛┃ノ) 6 ┓┏┓┏┓┃ 7 ┛┗┛┗┛┃ 8 ┓┏┓┏┓┃ 9 ┛┗┛┗┛┃ 10 ┓┏┓┏┓┃ 11 ┛┗┛┗┛┃ 12 ┓┏┓┏┓┃ 13 ┃┃┃┃┃┃ 14 ┻┻┻┻┻┻ 15 */ 16 #include <algorithm> 17 #include <iostream> 18 #include <iomanip> 19 #include <cstring> 20 #include <climits> 21 #include <complex> 22 #include <fstream> 23 #include <cassert> 24 #include <cstdio> 25 #include <bitset> 26 #include <vector> 27 #include <deque> 28 #include <queue> 29 #include <stack> 30 #include <ctime> 31 #include <set> 32 #include <map> 33 #include <cmath> 34 using namespace std; 35 #define fr first 36 #define sc second 37 #define cl clear 38 #define BUG puts("here!!!") 39 #define W(a) while(a--) 40 #define pb(a) push_back(a) 41 #define Rlf(a) scanf("%lf", &a); 42 #define Rint(a) scanf("%d", &a) 43 #define Rll(a) scanf("%I64d", &a) 44 #define Rs(a) scanf("%s", a) 45 #define Cin(a) cin >> a 46 #define FRead() freopen("in", "r", stdin) 47 #define FWrite() freopen("out", "w", stdout) 48 #define Rep(i, len) for(int i = 0; i < (len); i++) 49 #define For(i, a, len) for(int i = (a); i < (len); i++) 50 #define Cls(a) memset((a), 0, sizeof(a)) 51 #define Clr(a, x) memset((a), (x), sizeof(a)) 52 #define Full(a) memset((a), 0x7f7f, sizeof(a)) 53 #define lrt rt << 1 54 #define rrt rt << 1 | 1 55 #define pi 3.14159265359 56 #define RT return 57 #define lowbit(x) x & (-x) 58 #define onenum(x) __builtin_popcount(x) 59 typedef long long LL; 60 typedef long double LD; 61 typedef unsigned long long ULL; 62 typedef pair<int, int> pii; 63 typedef pair<string, int> psi; 64 typedef map<string, int> msi; 65 typedef vector<int> vi; 66 typedef vector<LL> vl; 67 typedef vector<vl> vvl; 68 typedef vector<bool> vb; 69 70 double d, h, v, e; 71 int main() { 72 // FRead(); 73 cin >> d >> h >> v >> e; 74 d /= 2; 75 if(v / (pi * d * d) <= e) printf("NO "); 76 else printf("YES %.10f", h / (v / (pi * d * d) - e)); 77 RT 0; 78 }