Sum-up the Primes

We all know from Goldbachs conjecture that any even number greater than 2 can be expressed as a summation of two primes. Some odd numbers can also be expressed as summation of two primes. In this problem you will have to express a number as a summation of arbitrary number of primes less than 300. The conditions in detail are as follows:

  1. You have to express a number N (N ≤ 1000) as a summation of t (t ≤ 14) primes.
  2. Among the t primes any single odd primes can be present maximum two times. 2 can be present only once. For example, (5+5+3+3) is valid, but (3+3+3+7) or (2+2+3) is invalid according to this particular rule.
  3. All the prime numbers used must be less than 300.
  4. If there is more than one solution print the lexicographically smallest one.
  5. If there is no such expression of primes print the string ‘No Solution.’. Input The input file contains less than 9340 lines of input. Each line contains two numbers N (0 < N ≤ 1000) and t (0 < t ≤ 14). The meaning of N and t are described in the problem statement. Input is terminated by a line where N = 0 and t = 0. This line should not be processed. Output For each line of input produce a block of 2 lines. The first line of such a block contains the output serial as shown in the sample output. Next line contains the lexicographically smallest expression that sums up to N. There is no space between the operators and operands. If N cannot be expressed as a summation of t primes output ‘No Solution.’. Sample Input 20 10 100 4 10 2 00 Sample Output CASE 1: No Solution. CASE 2: 11+11+17+61 CASE 3: 3+7