L. Putting plates on the tuk-tuks

Codeforces
IDCF10104L
Time2000ms
Memory64MB
Difficulty
English · Original
Formal · Original
The _tuk-tuk_ (ตกตก), also known as "auto rickshaw," is a popular form of transportation in Thailand. In order to distinguish _tuk-tuks_ from the other types of vehicles, the Phuket administration decided to create a new license plate system for them. Phuket's _tuk-tuk_ fleet has been growing rapidly, mostly due to tourism, one of the most important economic activities in the province. The administration plans the new system to meet the demand for distinct license plates for the next 42 years. A license plate system is defined by two numbers, C and D. A license plate in this system is a string formed by C consonants followed by D digits. A license plate cannot be empty (no consonant and no digit). In the Thai alphabet there are 44 consonants and 10 digits. However, since the symbols of some consonants are too much alike, the administration decided to use only 26 consonants, whose symbols were considered sufficiently distinguishable. To guarantee an appropriate supply of _tuk-tuks_ for the contestants in the ICPC World Finals in 2016, Phuket's administration would like to know the number of distinct license plates it is possible to generate with a given license plate system. The first line has a single integer T, the number of test cases. Each test case consists of a single line containing two integers C and D, the number of consonants and digits, respectively, in a license plate system. *Limits* For each test case, print a line with the amount of distinct license plates that can be generated by the corresponding system. The answer is guaranteed to be smaller than 231. ## Input The first line has a single integer T, the number of test cases.Each test case consists of a single line containing two integers C and D, the number of consonants and digits, respectively, in a license plate system.*Limits* 1 ≤ T ≤ 20 0 ≤ C ≤ 6 0 ≤ D ≤ 9 ## Output For each test case, print a line with the amount of distinct license plates that can be generated by the corresponding system. The answer is guaranteed to be smaller than 231. [samples]
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $, let $ C_k, D_k \in \mathbb{Z} $ denote the number of consonants and digits, respectively, in the license plate system. **Constraints** 1. $ 1 \le T \le \text{unknown (but finite)} $ 2. For each $ k \in \{1, \dots, T\} $: - $ C_k \ge 0 $, $ D_k \ge 0 $ - $ C_k + D_k \ge 1 $ (license plate cannot be empty) - The alphabet provides 26 distinguishable consonants and 10 digits. **Objective** For each test case $ k $, compute the number of distinct license plates: $$ N_k = (26)^{C_k} \times (10)^{D_k} $$
API Response (JSON)
{
  "problem": {
    "name": "L. Putting plates on the tuk-tuks",
    "description": {
      "content": "The _tuk-tuk_ (ตกตก), also known as \"auto rickshaw,\" is a popular form of transportation in Thailand. In order to distinguish _tuk-tuks_ from the other types of vehicles, the Phuket administration dec",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10104L"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "The _tuk-tuk_ (ตกตก), also known as \"auto rickshaw,\" is a popular form of transportation in Thailand. In order to distinguish _tuk-tuks_ from the other types of vehicles, the Phuket administration dec...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $, let $ C_k, D_k \\in \\mathbb{Z} $ denote the number of consonants and digits, resp...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments