AdvancedRating 2000
Insert Operators to Hit a Target
Insert +, − or * between the digits (or nothing, to join digits into a longer number) so that the expression equals t. Numbers may not have leading zeros. Print all expressions in alphabetical order, or NONE.
Input
A digit string (length ≤ 9), then t.
Output
Lines.
Sample 1
Input
123 6
Output
1*2*3 1+2+3
Sample 2
Input
232 8
Output
2*3+2 2+3*2
Output appears here