Skip to content

Commit

Permalink
Added 20th Day Question
Browse files Browse the repository at this point in the history
  • Loading branch information
C3Suryansu committed Oct 10, 2021
1 parent 6d24064 commit 150ed36
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Day 20/Problem Statement 20.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Tony has been assigned a number n and was asked to represent it as a sum of maximum possible number of prime numbers.One can prove that such representation exists for any integer greater than 1. Help Tony to solve this problem.

Input variables:-
int t=> no. of test cases
int n=> assigned number

Input Description:-
-First line of input consists of t, the number of test cases
-Next each lines consist of n, the assigned number

Output Description:-
-The first line of the output contains a single integer k — maximum possible number of primes in representation.
-The second line should contain k primes with their sum equal to n. You can print them in any order. If there are several optimal solution, print any of them.

Constraints:-
-> 1<=t<=100
-> 1<=n<=1000

Sample Input:-
2
5
6

Sample Output:-
2
2 3
3
2 2 2

101 changes: 101 additions & 0 deletions Day 20/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
100
367
358
569
637
696
165
785
924
433
292
479
590
61
964
825
417
263
68
728
907
611
362
590
780
443
30
818
904
44
808
431
108
683
636
81
762
574
74
897
163
657
859
889
339
629
342
792
897
935
881
646
480
577
458
111
24
673
474
471
455
460
234
613
153
858
531
97
970
727
497
658
286
454
842
500
8
784
612
436
217
326
577
148
263
475
85
66
857
693
372
49
944
295
460
949
893
212
175
483
539

0 comments on commit 150ed36

Please sign in to comment.