fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for(int i=0;i<2;i++){
  6. long long t, x, y, s;
  7. cin >> t >> x >> y >> s;
  8. long long namTime = s * y;
  9. long long khanhTime = (t * x * y) + (s * y);
  10. if (t * x * y + s * y < s * x) {
  11. cout << "Khanh" << endl;
  12. } else if (t * x * y + s * y > s * x) {
  13. cout << "Nam" << endl;
  14. } else {
  15. cout << "Fare" << endl;
  16. }
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5324KB
stdin
2 5 3 7
1 6 3 6
stdout
Nam
Fare