fork download
  1. #include<bits/stdc++.h>
  2. #define ll long long int
  3. #define F first
  4. #define S second
  5. #define pb push_back
  6. #define sd(x) scanf("%d",&x)
  7. #define sd2(x,y) scanf("%d%d",&x,&y);
  8. #define sdl(x) scanf("%lld",&x)
  9. #define sd2l(x,y) scanf("%lld%lld",&x,&y);
  10. #define sz(x) (int)(x.size())
  11. #define nax 100010
  12. #define inf 1001000100
  13. #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  14. #define MOD 1000000007
  15. #define mp make_pair
  16. #define pc pair<char ,int>
  17. #define pi pair<int ,int>
  18. #define pii pair <int,pi>
  19. #define ull unsigned long long int
  20. #define eps 1e-9
  21. using namespace std;
  22. int main() {
  23. //freopen("input.txt","r",stdin);
  24. //freopen("output.txt","w",stdout);
  25. int t;
  26. sd(t);
  27. while(t--)
  28. {
  29. int b1,p1,b2,p2;
  30. sd2(b1, p1);
  31. sd2(b2, p2);
  32. if(b1 == 0)
  33. {
  34. if(b2 == 0)
  35. puts("Lazy");
  36. else
  37. puts("Congrats");
  38. continue;
  39. }
  40. if(b2 == 0)
  41. {
  42. puts("HaHa");
  43. continue;
  44. }
  45. double v1 = p1 * log(b1);
  46. double v2 = p2 * log(b2);
  47. if(abs(v1 - v2) < eps)
  48. puts("Lazy");
  49. else if(v1 > v2)
  50. puts("HaHa");
  51. else
  52. puts("Congrats");
  53. }
  54. return 0;
  55. }
Success #stdin #stdout 0s 15232KB
stdin
3
2 3 4 2
2 2 3 1
2 4 4 2

stdout
Congrats
HaHa
Lazy