• [1207] Chihuo VIII - Do Accounts

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • After Zhengling had hunted down Tianyi, they come back to home.
    To their surprise, this eating journey just cost them little money. It's between 1 and 100.

    Tianyi is so naughty that she play with this number immediately. She found that this number can be represented by mixed numbers like that:

      B
    A---
      C
    And each digits of 1~9 will only and must appear once.
    For example, the number 6 can be represented like that:
         7436
    6 = 2----
         1859


    Now Tianyi invites you to help her find all the representions for one number between 1 and 100.

  • 输入
  • This problem contains several cases. Input until 0.
    Each cases contains only one integer N (1 <= N <= 100).
  • 输出
  • For each case, you should output all the representions. Order by A increasing, then order by B increasing.
    If there's no represention, output "impossible".
  • 样例输入
  • 45
    1
    0
    
  • 样例输出
  •      3564
    45=27----
          198
         4172
    45=38----
          596
    impossible
    
  • 提示
  • 来源
  • XadillaX
  • 操作

显示春菜