Uploaded
ACM _ Wang Ying
Idea: forward to gold, "reverse gold (Ron)
Forward: K = B/c * d
Reverse: q = (k/E) * F
W = (Q/a) * B
P = (W/C) * D // reverse gold
Note that the input value can be 0.
1. When a = 0 BCD, infinite gold ron C = 0 & D infinitely turns out gold Ron
2. When (a = 0 | C = 0 | E = 0) & B, D, and F are infinite gold
3. when (A = 0 & B = 0) | (E = 0 & F = 0) | (C = 0 & D = 0) there is a link in herminoe that cannot be converted
(The syy code is simpler than the one I wrote)
#include<stdio.h>int main(){ double a,b,c,d,e,f; while(~scanf("%lf%lf%lf%lf%lf%lf",&a,&b,&c,&d,&e,&f)) { if(c==0&&d) { printf("Ron\n"); continue; } if(a==0&&b&&c&&d) { printf("Ron\n"); continue; } if((a==0||c==0||e==0)&&b&&d&&f) { printf("Ron\n"); continue; } if((a==0&&b==0)||(e==0&&f==0)||(c==0&&d==0)) { printf("Hermione\n"); continue; } double k=(b/c)*d; double q=(k/e)*f; double w=(q/a)*b; double p=(w/c)*d; if(p>k) printf("Ron\n"); else printf("Hermione\n"); } return 0;}