DCP-379: SUMMATION Back to All Problems

Easy Math > Basic Math


You are given an array of integer. You have to find the sum of all possible **subsequence** sum of the array. For example: The given array A of length N = 3 is {1 , 2 , 3}. All the subsequence of this array with the corresponding array Sum are: ![enter image description here][1] The answer is 24. Note: subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. there will be total 2^n subsequences of an array of length n. Input: ------ Input starts with an integer **T (1≤T≤10)**, denoting the number of test cases. Each case contains an integer **N (3 ≤ N ≤ 1000)** denoting the number of elements of array A. The next line will contain n integers separated by spaces, denoting the elements of the array A. Each of these integers will be between 1 and 100000000 (inclusive). Output: ------- For each case of input, output the answer of the problem in the format "**Case X: Y**" where **X** denotes the number of test case and **Y** denotes the answer. <br> Answer could be very large so output the answer modulo **100000007**. Sample Input ------------ 2 3 1 2 3 3 4 1 2 Sample Output ------------- Case 1: 24 Case 2: 28 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/1e107369-957b-ca00-d055-08d4bc74830f_eee9f72623514b61b689cc7201da594a_W553xH265.png


Problem Setter:

Suman Bhadra

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

109/433

Solve/Submission

Ranking

# User Language Timing
01 dmehrab06 Cpp14 0.00s
02 asif3058 Cpp 0.00s
03 sahedsohel Cpp 0.00s
04 BishalG Cpp 0.00s
05 siamcr7 Cpp 0.00s
06 akib9ctg Cpp 0.00s
07 Hawk Cpp 0.00s
08 ksohan Cpp 0.00s
09 smjlord068 Cpp 0.00s
10 PKP_007 Cpp 0.00s
11 flash_7 Cpp14 0.00s
12 aseem_cu Cpp 0.00s
13 Trusted_Frustrated Cpp 0.00s
14 sazal_dev Cpp 0.00s
15 Najat Cpp 0.00s
16 rayhan50001 Cpp 0.00s
17 pulak_ict_mbstu Cpp 0.00s
18 motaleb_ICT Cpp 0.00s
19 hiddenhopes Cpp 0.00s
20 Reayz Cpp 0.00s
21 Aizen Cpp 0.00s
22 ashraful_afruz Cpp 0.00s
23 IIUC_minhazmiraz Cpp 0.00s
24 feodorv C 0.00s
25 mir003 Cpp 0.00s
26 ovis96 Cpp14 0.00s
27 tajri Cpp 0.00s
28 unknown420 Cpp 0.00s
29 trifiasco Cpp 0.00s
30 _dipu Cpp14 0.00s
31 last Cpp 0.00s
32 daihan_mbstu Cpp 0.00s
33 Morass Cpp14 0.00s
34 Not_Found0001 Cpp 0.00s
35 zahidsheikh Cpp 0.00s
36 SugiuraAyano C 0.01s
37 Rajan_sust Cpp14 0.01s
38 shuvo_mbstu Cpp 0.01s
39 wayne6172 C 0.01s
40 prateepm Cpp14 0.01s
41 lsiddiqsunny Cpp 0.01s
42 Bisnu039 C 0.01s
43 Bruteforcekid Cpp14 0.01s
44 tlcakash Cpp 0.01s
45 SakibAlamin Cpp14 0.01s
46 ____ Cpp 0.01s
47 indroneel Cpp 0.01s
48 DynamicOvi Cpp 0.01s
49 Ishraq_Nibir Cpp 0.01s
50 monir769 Cpp 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support