#P1618. 三连击(升级版)

三连击(升级版)

Description

Divide the 99 numbers 1,2,,91, 2,\ldots, 9 into three groups to form three three-digit numbers, such that these three three-digit numbers are in the ratio A:B:C. Find all triples that satisfy the condition; if there is no solution, output No!!!.

Thanks to Huang Xiao U Beverage for improving the problem statement.

Input Format

Three numbers, A, B, C.

Output Format

Several lines, each containing 3 numbers. Sort the lines by the first number in ascending order.

1 2 3
192 384 576
219 438 657
273 546 819
327 654 981

Hint

It is guaranteed that 0A<B<C9990 \le A < B < C \le 999.

upd 2022.8.3\text{upd 2022.8.3}: Added two more hack testdata.

Translated by ChatGPT 5