#include typedef unsigned short ushort; void numin(ushort index, ushort *numBox) { char str; for (ushort i = 0; i '9') cnt++; else numBox[cnt] = numBox[cnt] * 10 + (ushort)str - (ushort)'0'; } } int main() { ushort number=0; ushort total =0; ushort value[50]; // 入力処理 scanf("%hu", &number); scanf("%hu", &total); numin(number, value); ushort ans = value[0]; ushort cnt = 0; unsigned long long switcher = 0; // 計算処理 while (1) { // 計算 if ((switcher >> cnt) & 1) ans *= value[cnt + 1]; else ans += value[cnt + 1]; if (ans >= total) { if (ans == total && cnt == number - 2) break; else { ans = value[0]; cnt = 0; switcher++; } } else if (cnt < number - 2) { cnt++; } else { ans = value[0]; cnt = 0; switcher++; } } for (int i = 0; i < number - 1; i++) { if((switcher >> i) & 1) printf("*"); else printf("+"); } return 0; }