#P8723. [蓝桥杯 2020 省 AB3] 乘法表

[蓝桥杯 2020 省 AB3] 乘法表

Problem Description

The 9×99 \times 9 multiplication table is something you must learn when studying multiplication. Under different bases, you need different multiplication tables.

For example, the multiplication table in base 44 is as follows:

1*1=1
2*1=2 2*2=10
3*1=3 3*2=12 3*3=21

Note that the order of the two numbers being multiplied in the table must be the same as in the sample, and you cannot swap the two factors freely.

Given PP, output the multiplication table in base PP.

Input Format

Input one integer PP.

Output Format

Output the multiplication table in base PP. Digits in base PP that are greater than or equal to 1010 are represented by uppercase letters A, B, C, \cdots.

4
1*1=1
2*1=2 2*2=10
3*1=3 3*2=12 3*3=21
8
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=11
4*1=4 4*2=10 4*3=14 4*4=20
5*1=5 5*2=12 5*3=17 5*4=24 5*5=31
6*1=6 6*2=14 6*3=22 6*4=30 6*5=36 6*6=44
7*1=7 7*2=16 7*3=25 7*4=34 7*5=43 7*6=52 7*7=61

Hint

For all testdata, 2P362 \leq P \leq 36.

Lanqiao Cup 2020, Round 3 Provincial Contest, Group AB, Problem G.

Translated by ChatGPT 5