Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <cstdio>
int main(){
long a,b,c,d,e,f; scanf("%ld %ld %ld %ld %ld %ld", &a, &b, &c, &d, &e, &f);
puts((!a && b && d) || (!c && d)|| (b * d * f > a * c * e) ? "Ron" : "Hermione");
return 0;
}
Copy The Code &
Try With Live Editor
Input
100 200 250 150 200 250
Output
Ron
Demonstration
Codeforces Solution-A. Harry Potter and Three Spells-Solution in C, C++, Java, Python