A toothpick expression uses toothpicks to represent a positive integer. The expression consists of operands and operators.
Each operand consists of one or more vertical toothpicks ("|"); the value of the operand is the number of toothpicks.
The operators that can appear in an expression are addition and multiplication. The addition operator is the plus sign ("+"), which consists of one vertical and one horizontal toothpick. The multiplication operator is the letter "x", which also consists of two toothpicks. Multiplication has precedence over addition.
The expression must begin with an operand. Thereafter, operators and operands alternate. Finally, the expression must end with an operand. Given a positive integer, your program must represent it as a toothpick expression, using the smallest number of toothpicks.