
ZOJ Problem Set  2529
If you are a fan of Harry Potter, you would know the school he is attending to, the Hogwarts School for Witchcraft and Wizardry. What you might not know is that Harry is never good at math, yet he doesn't want to bother Hermione for trivial A+B problems. Now your job is to write a simple calculator for him  the calculator is so simple that it handles nonnegative integer additions only. What is not so simple is that the world of Witchcraft and Wizardry dosen't use a fixed radix numeration system. That is, an integer is represented with different radices for different digits  the radix for the ith digit is the ith prime number. For example, the decimal number 2 is 10 in Hogwarts (let's denote it by 2_{10} = 1,0_{H}) since the radix for the 1st digit is the 1st prime number 2. Similarly we have 6_{10} = 1,0,0_{H} since the radix for the 2nd digit is 3. InputThe input consists of multiple test cases, each occupies a line with two integers in Hogwarts' system. Digits of a Hogwarts' integer are seperated by ',' and the two numbers are seperated by a space. Each number has at most 25 digits. OutputFor each test case, print in one line the sum of the two given numbers in Hogwarts' system. Sample Input1,0 2,1 4,2,0 1,2,0 1 10,6,4,2,1Sample Output 1,0,1 1,1,1,0 1,0,0,0,0,0 Author: CHEN, Yue Source: CYJJ's Funny Contest #3, Having Fun in Summer 