075. Shopping Spree

Codeforces
IDCF10269075
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You've been selected to be the recipient of Wegman's shopping spree program! The only caveat is that you have to be continuously moving through the building at all times, through the different sections in a circular pattern, so you will only have time to grab one item from each section. It will also take some time for you to move to the different locations of the store, and luckily, this Wegmans only has 3 sections, as the architect designing this location was lazy with his design. You want to know how many loops it will take you to get a certain amount of different types of items. The first line will contain an integer $n$, which denotes the amount of test cases that will follow. These test cases will each contain 3 different, space-separated integers denoting the amount of different items you will need to complete the shopping list. The first line will always be Produce $p$, the second will be Meat $m$, and the third will be dry goods $d$. Return the amount of loops it will take for you to complete your shopping list. ## Input The first line will contain an integer $n$, which denotes the amount of test cases that will follow. These test cases will each contain 3 different, space-separated integers denoting the amount of different items you will need to complete the shopping list.The first line will always be Produce $p$, the second will be Meat $m$, and the third will be dry goods $d$. ## Output Return the amount of loops it will take for you to complete your shopping list. [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, n\} $, let $ (p_k, m_k, d_k) \in \mathbb{Z}_{>0}^3 $ denote the required quantities of Produce, Meat, and Dry Goods, respectively. **Constraints** 1. $ 1 \le n \le 1000 $ 2. For each $ k \in \{1, \dots, n\} $: $ p_k, m_k, d_k \ge 1 $ **Objective** For each test case $ k $, compute the minimum number of loops $ L_k $ such that: $$ L_k = \max(p_k, m_k, d_k) $$
API Response (JSON)
{
  "problem": {
    "name": "075. Shopping Spree",
    "description": {
      "content": "You've been selected to be the recipient of Wegman's shopping spree program! The only caveat is that you have to be continuously moving through the building at all times, through the different section",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269075"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You've been selected to be the recipient of Wegman's shopping spree program! The only caveat is that you have to be continuously moving through the building at all times, through the different section...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, n\\} $, let $ (p_k, m_k, d_k) \\in \\mathbb{Z}_{>0}^3 $ denote the required quantities of ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments