### Woburn Challenge 1996

## Problem 6: Different Bases Multiplication

In normal everyday usage numbers are thought of in base ten. The reason for this is naturally due to humans having ten fingers on which to perform mathematical operations such as add, subtract and multiply. However, in computer technology, the use of low and high voltage states lends itself to thinking of operations defined on having only these two states. Hence, the binary system as a descriptive tool in computers in quite useful. Moreover, we could easily have a use for other number systems (cartoon characters couting in base 8, some alien species counting in base 97).

Your task is to take two different-base numbers, calculate their product, and return the answer in another base.

For example, "Find 12_{8} * 35_{9} in base 10."

### Input

The input file contains 5 data sets.

The first line of each data set is the first number and its base.

The second line of each data set is the second number and its base.

The third line of each data set is the base in which the product is to be reported.

All bases will be integers from 2 to 10 inclusive.

### Output

Give the product of the numbers in the specified base.

Each product will be less than or equal to 2 billion (base ten).

### Sample Input

12 8 35 9 10 121 7 121 7 7

(and 3 more inputs)

### Sample Output

320 14641

All Submissions

Best Solutions

**Point Value:** 5

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Sep 29, 2008

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

zhxl0903on Jan 09, 2009 - 11:57:16 pm UTC what's the first test case?SourSpinachon Jan 10, 2009 - 12:28:41 am UTC Re: what's the first test case?zhxl0903on Jan 10, 2009 - 1:06:01 am UTC Re: Re: what's the first test case?zhxl0903on Jan 09, 2009 - 7:32:48 pm UTC Is pascal longint large enough for this program?jargonon Jan 09, 2009 - 8:36:11 pm UTC Re: Is pascal longint larger enough for this program?ragulan5on Dec 12, 2008 - 12:44:07 am UTC Negativeszerglingrushon Dec 12, 2008 - 1:10:52 am UTC NegativesdAedaLon Dec 12, 2008 - 4:01:47 am UTC Re: NegativesSaravannanon Dec 12, 2008 - 8:20:40 pm UTC Re: Re: Negatives