toonewbie

Untitled

Apr 7th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. /****Author: Barish Namazov****/
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. /***TEMPLATE***/
  7. #define all(v) (v).begin(),(v).end()
  8. #define rall(v) (v).rbegin(),(v).rend()
  9.  
  10. #define F first
  11. #define S second
  12. #define pb push_back
  13.  
  14. #define endl '\n'
  15.  
  16. const int max4 = 10004;
  17. const int maxx = 100005;
  18. const int max6 = 1000006;
  19. const int lg5 = 17;
  20.  
  21. const int INF = 2 * 1000000007;
  22. const long long INFLL = 4LL * 1000000000 * 1000000000;
  23.  
  24. /***************/
  25.  
  26. int powmod (int a, int b, int mod) {
  27. int res = 1; a %= mod;
  28. for (; b; b >>= 1) {
  29. if (b & 1) {
  30. res = 1LL * res * a % mod;
  31. }
  32. a = 1LL * a * a % mod;
  33. }
  34. return res;
  35. }
  36.  
  37. int gcd (int a, int b) {
  38. while (b > 0) {
  39. int t = a % b;
  40. a = b, b = t;
  41. }
  42. return a;
  43. }
  44.  
  45. int lcm (int a, int b) {
  46. return (a / gcd (a, b)) * b;
  47. }
  48.  
  49. int is_prime (int n) {
  50. if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
  51. return 0;
  52. for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
  53. if (n % i == 0)
  54. return 0;
  55. return 1;
  56. }
  57.  
  58. /******Don't forget to use long long when needed!!******/
  59.  
  60. const long double EPS = 1e-9;
  61.  
  62. int main() {
  63. //freopen("in.txt","r",stdin);
  64. //freopen("out.txt","w",stdout);
  65. ios_base :: sync_with_stdio(0);
  66. cin.tie(0), cout.tie(0);
  67. int T;
  68. cin >> T;
  69. while (T --) {
  70. int a, b, x, y;
  71. cin >> a >> b >> x >> y;
  72. long double A, B;
  73. A = 1.0 * b * log10(a);
  74. B = 1.0 * y * log10(x);
  75. if (A > B + EPS) {
  76. cout << "HaHa" << endl;
  77. } else if (A < B - EPS) {
  78. cout << "Congrats" << endl;
  79. } else {
  80. cout << "Lazy" << endl;
  81. }
  82. }
  83. return 0;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment