Base K

AtCoder
IDabc220_b
Time2000ms
Memory256MB
Difficulty
You are given integers $A$ and $B$, in base $K$. Print $A \times B$ in decimal. ## Constraints * $2 \leq K \leq 10$ * $1 \leq A,B \leq 10^5$ * $A$ and $B$ are in base-$K$ representation. ## Input Input is given from Standard Input in the following format: $K$ $A$ $B$ [samples] ## Notes For base-$K$ representation, see [Wikipedia's article on Positional notation](https://en.wikipedia.org/wiki/Positional_notation).
Samples
Input #1
2
1011 10100
Output #1
220

`1011` in base $2$ corresponds to $11$ in base $10$.  
`10100` in base $2$ corresponds to $20$ in base $10$.  
We have $11 \times 20 = 220$, so print $220$.
Input #2
7
123 456
Output #2
15642

`123` in base $7$ corresponds to $66$ in base $10$.  
`456` in base $7$ corresponds to $237$ in base $10$.  
We have $66 \times 237 = 15642$, so print $15642$.
API Response (JSON)
{
  "problem": {
    "name": "Base K",
    "description": {
      "content": "You are given integers $A$ and $B$, in base $K$.   Print $A \\times B$ in decimal.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc220_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given integers $A$ and $B$, in base $K$.  \nPrint $A \\times B$ in decimal.\n\n## Constraints\n\n*   $2 \\leq K \\leq 10$\n*   $1 \\leq A,B \\leq 10^5$\n*   $A$ and $B$ are in base-$K$ representation.\n\n##...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments