import java.util.Scanner; public class PlusOrMult_2 { public static void main(String[] args) { PlusOrMult_2 p = new PlusOrMult_2(); } public PlusOrMult_2() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int total = sc.nextInt(); int[] a = new int[n]; for(int i=0;i= a.length){ if(cur==total) return true; else return false; } if(cur > total) return false; if(memo[c][cur]) return false; boolean res = rec(c+1, total, cur+a[c], a); if(res){ sb.insert(0, '+'); return true; } res = rec(c+1, total, cur*a[c], a); if(res){ sb.insert(0, '*'); return true; } memo[c][cur] = true; return false; } }