Long, Long Division

Input file: longdiv.in
Output file: longdiv.out

The Problem

You have been assigned to a team of software-hardware engineers working on supercomputer development. Your task is to write software for implementing multiple digit division, which is to divide any integer of 40 or fewer digits by any positive divisor less than 100.

Data in the input line comes in pairs, with the first line containing the dividend and the second line containing the divisor. Your program is to accept only correct dividends and divisors. Thus, if either the divident or its divisor contains any non-digit, i.e., a character not in [0..9], or the divisor is greater than 99 you are to print an error message, as shown below in the example data, between the dividend/divisor pairs.

If you read in two valid values, you are to compute the quotient and remainder and output the results as shown on the sample output shown below. You are to use normal end-of-file methods to terminate your reads from the input data file. Always skip a line, as shown below in the example data, between the dividend/divisor pairs.

Input

3845098340950934858345080594385091259814
97
9
3
815777777A
51
432567
125

Output

The correct output for the above test data is shown below. Make sure that your output matches the number form and case shown.
Dividend is 3845098340950934858345080594385091259814
Divisor is 97
Quotient is 39640189081968400601495676230774136699
Remainder is 11

Dividend is 9
Divisor is 3
Quotient is 3
Remainder is 0

Dividend is 815777777A
Divisor is 51
Illegal Dividend 815777777A

Dividend is 432567
Divisor is 125
Illegal Divisor 125