To help students better understand the topic of 'Multiplying Two Real Numbers,' a mathematics teacher decided to create a large number of illustrative examples. For this, he needs a program that can generate the appropriate examples.
Write a program that will display the multiplication of two given real numbers in column format.
Two lines containing positive numbers (up to decimal places and up to whole digits).
In the first two lines, display the numbers in the same format as in the input data, aligned to the right. In the next line, display a separator consisting of 'minus' symbols, with a quantity equal to the number of characters in the result of multiplying these two numbers.
In the next lines, display intermediate calculations – the results of multiplying the first number by each digit of the second number with the corresponding alignment.
If there are '' digits in the second number, no row should be displayed for them in the intermediate result.
If at least one of the numbers in the input data is fractional, the intermediate calculation result should be represented as a fractional number (examples , , ).
After displaying the calculations, the separator of 'minus' symbols is displayed again.
In the last line, display the overall result.
If the intermediate calculations include only one row, this calculation is not displayed, and the result is recorded immediately (example ).
Example 1
Example 2
Example 3
Example 4