A. Hulk

Codeforces
IDCF705A
Time1000ms
Memory256MB
Difficulty
implementation
English · Original
Chinese · Translation
Formal · Original
Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings. Hulk likes the Inception so much, and like that his feelings are complicated. They have _n_ layers. The first layer is hate, second one is love, third one is hate and so on... For example if _n_ = 1, then his feeling is "_I hate it_" or if _n_ = 2 it's "_I hate that I love it_", and if _n_ = 3 it's "_I hate that I love that I hate it_" and so on. Please help Dr. Banner. ## Input The only line of the input contains a single integer _n_ (1 ≤ _n_ ≤ 100) — the number of layers of love and hate. ## Output Print Dr.Banner's feeling in one line. [samples]
布鲁斯·班纳博士讨厌他的敌人(就像其他人一样)。众所周知,当他变成无敌浩克时,他几乎无法说话。因此,他请你帮助他表达自己的感受。 浩克非常喜爱《盗梦空间》,因此他的感受也很复杂。它们有 #cf_span[n] 层。第一层是讨厌,第二层是爱,第三层是讨厌,依此类推... 例如,如果 #cf_span[n = 1],他的感受是 "_I hate it_";如果 #cf_span[n = 2],则是 "_I hate that I love it_";如果 #cf_span[n = 3],则是 "_I hate that I love that I hate it_",以此类推。 请帮助班纳博士。 输入仅包含一行,包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 100]) —— 爱与恨的层数。 请在一行中输出班纳博士的感受。 ## Input 输入仅包含一行,包含一个整数 #cf_span[n] (#cf_span[1 ≤ n ≤ 100]) —— 爱与恨的层数。 ## Output 请在一行中输出班纳博士的感受。 [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the number of layers, with $ 1 \leq n \leq 100 $. **Objective** Construct a string $ S_n $ defined recursively as: - $ S_1 = \text{"I hate it"} $ - For $ i \geq 2 $, $ S_i = \text{"I hate that "} S_{i-1} $ if $ i $ is odd, $ S_i = \text{"I love that "} S_{i-1} $ if $ i $ is even. Equivalently: $$ S_n = \bigoplus_{i=1}^{n} \left( \text{``I hate that ''} \cdot [i \text{ odd}] + \text{``I love that ''} \cdot [i \text{ even}] \right) \oplus \text{``it''} $$ where $ \oplus $ denotes string concatenation and $ [\cdot] $ is the Iverson bracket. **Output** Print $ S_n $.
Samples
Input #1
1
Output #1
I hate it
Input #2
2
Output #2
I hate that I love it
Input #3
3
Output #3
I hate that I love that I hate it
API Response (JSON)
{
  "problem": {
    "name": "A. Hulk",
    "description": {
      "content": "Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings. Hulk li",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF705A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings.\n\nHulk li...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "布鲁斯·班纳博士讨厌他的敌人(就像其他人一样)。众所周知,当他变成无敌浩克时,他几乎无法说话。因此,他请你帮助他表达自己的感受。\n\n浩克非常喜爱《盗梦空间》,因此他的感受也很复杂。它们有 #cf_span[n] 层。第一层是讨厌,第二层是爱,第三层是讨厌,依此类推...\n\n例如,如果 #cf_span[n = 1],他的感受是 \"_I hate it_\";如果 #cf_span[n = 2],则是...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of layers, with $ 1 \\leq n \\leq 100 $.  \n\n**Objective**  \nConstruct a string $ S_n $ defined recursively as:  \n- $ S_1 = \\text{\"I hate it\"} $  ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments