M. NCD Salary

Codeforces
IDCF10216M
Time3000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Each month, each student in NCD gets a salary of $B 1^(P 1)$ Liras. But when Ghaffar went to get his salary this month, he was surprised that he was given $B 2^(P 2)$ Liras. Because he is lazy, he asked you to determine whether the new salary is bigger or smaller than the original salary. The first line of input will be $T$, number of test cases. Each test case is described by four space separated integers, $B_1, P_1, B_2, P_2$ numbers given in the statement. $0 <= B, P <= 10^6$ It's guaranteed that at least one of the $B 1, P 1$ and one of the $B 2, P 2$ is not equal to zero. For each test case print "Congrats" if the new salary is bigger, print "HaHa" if it is smaller, and print "Lazy" if it is the same amount. ## Input The first line of input will be $T$, number of test cases.Each test case is described by four space separated integers, $B_1, P_1, B_2, P_2$ numbers given in the statement.$0 <= B, P <= 10^6$It's guaranteed that at least one of the $B 1, P 1$ and one of the $B 2, P 2$ is not equal to zero. ## Output For each test case print "Congrats" if the new salary is bigger, print "HaHa" if it is smaller, and print "Lazy" if it is the same amount. [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $, let $ (B_{1,k}, P_{1,k}, B_{2,k}, P_{2,k}) \in \mathbb{Z}_{\geq 0}^4 $ be the input parameters, with the constraint that at least one of $ B_{1,k}, P_{1,k} $ is nonzero and at least one of $ B_{2,k}, P_{2,k} $ is nonzero. **Constraints** 1. $ 1 \leq T \leq 10^5 $ (implied by input bounds) 2. $ 0 \leq B_{1,k}, P_{1,k}, B_{2,k}, P_{2,k} \leq 10^6 $ 3. $ (B_{1,k}, P_{1,k}) \neq (0,0) $ and $ (B_{2,k}, P_{2,k}) \neq (0,0) $ **Objective** For each test case $ k $, compare $ S_1 = B_{1,k}^{P_{1,k}} $ and $ S_2 = B_{2,k}^{P_{2,k}} $: - If $ S_2 > S_1 $, output "Congrats" - If $ S_2 < S_1 $, output "HaHa" - If $ S_2 = S_1 $, output "Lazy"
API Response (JSON)
{
  "problem": {
    "name": "M. NCD Salary",
    "description": {
      "content": "Each month, each student in NCD gets a salary of $B 1^(P 1)$ Liras. But when Ghaffar went to get his salary this month, he was surprised that he was given $B 2^(P 2)$ Liras. Because he is lazy, he as",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 3000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10216M"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Each month, each student in NCD gets a salary of $B 1^(P 1)$ Liras. But when Ghaffar went to get his salary this month, he was surprised that he was given $B 2^(P 2)$ Liras.\n\nBecause he is lazy, he as...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $, let $ (B_{1,k}, P_{1,k}, B_{2,k}, P_{2,k}) \\in \\mathbb{Z}_{\\geq 0}^4 $ be the in...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments