167. Blackjack

Codeforces
IDCF10269167
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
In the card game of blackjack, a player competes with a dealer, who in the first rounds, distributes two cards to both the player, and to themselves. These two cards determine the play of the next turn, as the objective of the game is to achieve a total score of 21, through the combination of number and face cards. Each face card is worth 10 points, while the number cards are worth their value points in their numbers. An ace, however, is worth 11 points, but if an ace causes the player's pool to go over its 21 point limit, it may become devalued to 1 point. You will be given two space-separated card values, the total of which will not be less than 10. Assume that given aces will automatically be valued at 11. Print out the card value that you must get for the next round in order to reach a score of 21. If 10 points are needed, print "FACE CARD/10". If the two given cards' total value is already equal to 21, print, "BLACKJACK". ## Input You will be given two space-separated card values, the total of which will not be less than 10. Assume that given aces will automatically be valued at 11. ## Output Print out the card value that you must get for the next round in order to reach a score of 21. If 10 points are needed, print "FACE CARD/10". If the two given cards' total value is already equal to 21, print, "BLACKJACK". [samples]
**Definitions** Let $ c_1, c_2 \in \mathbb{Z} $ be the values of the two given cards, where: - $ c_i \in \{2, 3, 4, 5, 6, 7, 8, 9, 10, 11\} $, - $ 11 $ represents an ace (valued at 11), - $ 10 $ represents any face card or 10. Let $ S = c_1 + c_2 $ be the current total score. **Constraints** 1. $ S \geq 10 $ 2. Aces are initially valued at 11 (no soft-hand adjustment considered). **Objective** Compute the required next card value $ x $ such that $ S + x = 21 $. - If $ S = 21 $, output **"BLACKJACK"**. - If $ x = 10 $, output **"FACE CARD/10"**. - Otherwise, output $ x $. That is: $$ x = 21 - S $$
API Response (JSON)
{
  "problem": {
    "name": "167. Blackjack",
    "description": {
      "content": "In the card game of blackjack, a player competes with a dealer, who in the first rounds, distributes two cards to both the player, and to themselves. These two cards determine the play of the next tur",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269167"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In the card game of blackjack, a player competes with a dealer, who in the first rounds, distributes two cards to both the player, and to themselves. These two cards determine the play of the next tur...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ c_1, c_2 \\in \\mathbb{Z} $ be the values of the two given cards, where:  \n- $ c_i \\in \\{2, 3, 4, 5, 6, 7, 8, 9, 10, 11\\} $,  \n- $ 11 $ represents an ace (valued at 11),  \n- $ 10...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments