E. New Max

Codeforces
IDCF10203E
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Kamal 'D has an array of size $N$. He can do at most $K$ operations on it, in each operation he can choose any element in the array and change its value to any other value $X$, $(1 <= x <= 400)$. Kamal 'D wants to know if he can make the maximum element in the new array equal to $M$. The first line of input will contain 3 integers $N$, $M$ and $K$ $(1 <= N <= 400)$ $(0 <= K <= 400)$ $(1 <= M <= 400)$ which are the size of the array, the new maximum value and the number of operations. The second line will contain $n$ integers, the $i_{t h}$ one is $a_i$ which is the $i_t h$ element in array $a$, $(1 <= a_i <= 400)$ For each test case, print "YES" if Kamal 'D can make the maximum element equals to M, print "NO" otherwise . ## Input The first line of input will contain 3 integers $N$, $M$ and $K$ $(1 <= N <= 400)$ $(0 <= K <= 400)$ $(1 <= M <= 400)$ which are the size of the array, the new maximum value and the number of operations.The second line will contain $n$ integers, the $i_{t h}$ one is $a_i$ which is the $i_t h$ element in array $a$, $(1 <= a_i <= 400)$ ## Output For each test case, print "YES" if Kamal 'D can make the maximum element equals to M, print "NO" otherwise . [samples]
**Definitions** Let $ N, M, K \in \mathbb{Z} $ be given integers with $ 1 \leq N \leq 400 $, $ 0 \leq K \leq 400 $, $ 1 \leq M \leq 400 $. Let $ A = (a_1, a_2, \dots, a_N) $ be a sequence of integers with $ 1 \leq a_i \leq 400 $ for all $ i $. **Constraints** Each operation allows changing any element $ a_i $ to any value $ x \in [1, 400] $. At most $ K $ operations may be performed. **Objective** Determine whether it is possible to perform at most $ K $ operations such that the maximum element of the resulting array is exactly $ M $, i.e., $$ \max_{1 \leq i \leq N} a_i' = M $$ where $ a_i' $ is the value of the $ i $-th element after operations.
API Response (JSON)
{
  "problem": {
    "name": "E. New Max",
    "description": {
      "content": "Kamal 'D has an array of size $N$. He can do at most $K$ operations on it, in each operation he can choose any element in the array and change its value to any other value $X$, $(1 <= x <= 400)$. Ka",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10203E"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Kamal 'D has an array of size $N$.\n\nHe can do at most $K$ operations on it, in each operation he can choose any element in the array and change its value to any other value $X$, $(1 <= x <= 400)$.\n\nKa...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N, M, K \\in \\mathbb{Z} $ be given integers with $ 1 \\leq N \\leq 400 $, $ 0 \\leq K \\leq 400 $, $ 1 \\leq M \\leq 400 $.  \nLet $ A = (a_1, a_2, \\dots, a_N) $ be a sequence of integ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments