1010. Radix
来源:互联网 发布:淘宝上的上海华硕商城 编辑:程序博客网 时间:2024/06/15 18:27
Now for any pair of positive integers N1 and N2, your task is to find the radix of one number while that of the other is given.
Input Specification:
Each input file contains one test case. Each case occupies a line which contains 4 positive integers:
N1 N2 tag radix
Here N1 and N2 each has no more than 10 digits. A digit is less than its radix and is chosen from the set {0-9, a-z} where 0-9 represent the decimal numbers 0-9, and a-z represent the decimal numbers 10-35. The last number "radix" is the radix of N1 if "tag" is 1, or of N2 if "tag" is 2.
Output Specification:
For each test case, print in one line the radix of the other number so that the equation N1 = N2 is true. If the equation is impossible, print "Impossible". If the solution is not unique, output the smallest possible radix.
Sample Input 1:6 110 1 10Sample Output 1:
2Sample Input 2:
1 ab 1 2Sample Output 2:
Impossible
- 1010.Radix
- 1010. Radix
- 1010. Radix
- 1010. Radix
- 1010. Radix
- 1010. Radix (25)
- 1010. Radix (25)
- 1010. Radix (25)-PAT
- 【PAT】1010. Radix (25)
- 1010. Radix (25)
- PAT 1010. Radix
- 1010. Radix (25)
- PAT 1010. Radix (25)
- 1010. Radix (25)
- PAT 1010. Radix (25)
- 1010. Radix (25)
- 1010. Radix (25)
- 1010. Radix (25) (JAVA)
- 1009. Product of Polynomials
- bzoj 1355 kmp
- 17.2.12 B 组 seek
- 1250
- 3888
- 1010. Radix
- UVALive - 7527 Funfair (动态规划)
- This view has crashed Markdown的渲染问题
- 图论最短路径算法——SPFA
- 3-安卓底层-实现安卓控制LED
- 1244
- 数据库索引系列四:索引算法Hash与BTree的区别
- bzoj2396 Cirno的完美算数教室 容斥
- 用缓冲流进行文件的复制