165. In The Zone

Codeforces
IDCF10269165
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
While doing your gym assignments in quarantine, your gym teacher makes you record your heart rate after your workouts, and separates them into five "zones". These zones of fitness are sorted dependant on your maximum heart rate (MHR), which is determined by taking your age, and subtracting it from 220. The zones are separated thusly: Zone 5: 90 - 100 percent of MHR Zone 4: 80 - 89 percent of MHR Zone 3 : 70 - 79 percent of MHR Zone 2 : 60 - 69 percent of MHR Zone 1 : <60 percent of MHR Given the first line as the age of the student, the second line will contain an integer $n$ which denotes the amount of test cases to follow. Print the appropriate fitness zone for each given test case. ## Input Given the first line as the age of the student, the second line will contain an integer $n$ which denotes the amount of test cases to follow. ## Output Print the appropriate fitness zone for each given test case. [samples]
**Definitions** Let $ a \in \mathbb{Z}^+ $ denote the age of the student. Let $ \text{MHR} = 220 - a $. Let $ n \in \mathbb{Z}^+ $ denote the number of test cases. Let $ H = (h_1, h_2, \dots, h_n) $ be a sequence of heart rate measurements, where $ h_i \in \mathbb{R}^+ $. **Constraints** 1. $ a \geq 1 $ 2. $ n \geq 1 $ 3. $ h_i > 0 $ for all $ i \in \{1, \dots, n\} $ **Objective** For each $ h_i $, determine the fitness zone $ z_i \in \{1, 2, 3, 4, 5\} $ based on: $$ z_i = \begin{cases} 5 & \text{if } 0.90 \cdot \text{MHR} \leq h_i \leq 1.00 \cdot \text{MHR} \\ 4 & \text{if } 0.80 \cdot \text{MHR} \leq h_i < 0.90 \cdot \text{MHR} \\ 3 & \text{if } 0.70 \cdot \text{MHR} \leq h_i < 0.80 \cdot \text{MHR} \\ 2 & \text{if } 0.60 \cdot \text{MHR} \leq h_i < 0.70 \cdot \text{MHR} \\ 1 & \text{if } h_i < 0.60 \cdot \text{MHR} \end{cases} $$ Output $ z_1, z_2, \dots, z_n $.
API Response (JSON)
{
  "problem": {
    "name": "165. In The Zone",
    "description": {
      "content": "While doing your gym assignments in quarantine, your gym teacher makes you record your heart rate after your workouts, and separates them into five \"zones\". These zones of fitness are sorted dependant",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269165"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "While doing your gym assignments in quarantine, your gym teacher makes you record your heart rate after your workouts, and separates them into five \"zones\". These zones of fitness are sorted dependant...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ a \\in \\mathbb{Z}^+ $ denote the age of the student.  \nLet $ \\text{MHR} = 220 - a $.  \nLet $ n \\in \\mathbb{Z}^+ $ denote the number of test cases.  \nLet $ H = (h_1, h_2, \\dots, ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments