Given two positive integers, \$A\$ and \$B\$, illustrate their least common multiple by outputting two lines of dashes (-
) with length \$\text{lcm}\$\$(A, B)\$ after replacing every \$A\$th dash in the first line and every \$B\$th dash in the second line with vertical bars (|
).
In this way, the end of each line will be the only place two |
's line up.
For example, if \$A = 6\$ and \$B = 4\$, \$\text{lcm}(6, 4) = 12\$, so:
two lines of 12 dashes: ------------ ------------ replace every 6th dash in the first line with a vertical bar: -----|-----| ------------ replace every 4th dash in the second line with a vertical bar: -----|-----| ---|---|---|
Thus the final output would be
-----|-----| ---|---|---|
The order of the input numbers should correspond to the order of the lines.
The shortest code in bytes wins.
Testcases
A B
line for A
line for B
1 1
|
|
1 2
||
-|
2 1
-|
||
2 2
-|
-|
6 4
-----|-----|
---|---|---|
4 6
---|---|---|
-----|-----|
2 3
-|-|-|
--|--|
3 2
--|--|
-|-|-|
3 6
--|--|
-----|
2 5
-|-|-|-|-|
----|----|
4 3
---|---|---|
--|--|--|--|
10 10
---------|
---------|
10 5
---------|
----|----|
10 6
---------|---------|---------|
-----|-----|-----|-----|-----|
24 8
-----------------------|
-------|-------|-------|
7 8
------|------|------|------|------|------|------|------|
-------|-------|-------|-------|-------|-------|-------|
6 8
-----|-----|-----|-----|
-------|-------|-------|
13 11
------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|------------|
----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|