Problem Description

Read a string num and base b (2 to 36). Convert num to decimal and output it. If conversion fails, output INVALID.

Input Format

One line: num base.

Output Format

Decimal or INVALID.

Sample Test Case

Input:
1a 16
Output:
26

Constraints

2

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next