Prime No. summation

Express a given number as a summation of 4 positive primes.
Time limit of execution is 3.00 seconds.
void prime_sum(int n,int sol[ ]);

The input contains one integer number N (N<=100000). This number you will have to express as a summation of 4 primes and an array of interger where you have to store all 4 numbers.
If summation is not possible then just fill first 4 entries of array as -1.

Sample Input :

28

42

Sample Output:

7 11 3 7

7 11 17 7
People aren't just going to do your homework for you. If you have a specific question as to the problem, ask it. Don't just expect people to hold your hand through an entire project.
Topic archived. No new replies allowed.