A. First Problem

Codeforces
IDCF10283A
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
This is the first problem. Not the second, nor the third, but only the very first. Will you be able to solve it? Well, of course that depends on how hard the problem is and how well you are able to perform at this particular moment in time. But I believe that you can do it! It just might take more or less _hypothetical time_. Given the hypothetical difficulty $D$ of this problem and your hypothetical performance rating $P$, compute the hypothetical time $T$ in seconds that it will take you to solve the first problem. You know that $T = D \/ P + 37$. The input to the first problem will consist of a single line containing two space-separated integers: $D$ and $P$ where $1 <= P <= D <= 10^9$. Print out the value of $T$, rounded to 3 decimal places. ## Input The input to the first problem will consist of a single line containing two space-separated integers: $D$ and $P$ where $1 <= P <= D <= 10^9$. ## Output Print out the value of $T$, rounded to 3 decimal places. [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the total amount of RMB yuan available for recharging. Let $ C = \{(p_i, v_i, r_i) \mid i \in \{1, \dots, 7\}\} $ be the set of recharge options, where: - $ p_i $: price in yuan, - $ v_i $: normal coupon amount, - $ r_i $: first-recharge bonus coupon amount. The seven options are: $$ \begin{aligned} &(1, 10, 8), \\ &(6, 60, 18), \\ &(28, 280, 28), \\ &(88, 880, 58), \\ &(198, 1980, 128), \\ &(328, 3280, 198), \\ &(648, 6480, 388). \end{aligned} $$ **Constraints** $ 1 \leq n \leq 2000 $ **Objective** Maximize the total coupons obtained by selecting non-negative integers $ x_i \in \mathbb{Z}_{\geq 0} $ (number of times option $ i $ is used), such that: $$ \sum_{i=1}^{7} x_i p_i = n $$ and the total coupon yield is: $$ \sum_{i=1}^{7} \left( x_i v_i + \delta_i r_i \right) $$ where $ \delta_i = 1 $ if $ x_i \geq 1 $, else $ 0 $ (i.e., bonus is awarded at most once per option). Find: $$ \max \sum_{i=1}^{7} \left( x_i v_i + \delta_i r_i \right) $$ subject to $ \sum_{i=1}^{7} x_i p_i = n $, $ x_i \in \mathbb{Z}_{\geq 0} $.
API Response (JSON)
{
  "problem": {
    "name": "A. First Problem",
    "description": {
      "content": "This is the first problem. Not the second, nor the third, but only the very first. Will you be able to solve it? Well, of course that depends on how hard the problem is and how well you are able to p",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10283A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "This is the first problem. Not the second, nor the third, but only the very first.\n\nWill you be able to solve it? Well, of course that depends on how hard the problem is and how well you are able to p...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the total amount of RMB yuan available for recharging.  \nLet $ C = \\{(p_i, v_i, r_i) \\mid i \\in \\{1, \\dots, 7\\}\\} $ be the set of recharge options, where:...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments