Medium Math > Big Integer Arithmetic

You are given an array of integer. You have to find the sum of all possible subsequences multiplication of the array. For example: The given array of length N = 3 is {1,2,3}. All the subsequence of this array with the corresponding array multiplication are: ![enter image description here][1] The answer is 23. 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 ( 1 ≤ 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 **10^9** (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. Answer could be very large so output the answer modulo **1006000007**. Sample Input ------------ 2 3 1 2 3 3 4 1 2 Sample Output ------------- Case 1: 23 Case 2: 29 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/d9c4db91-3a02-c17b-d60d-08d4bc7a9d59_d1622e6e41a64bd991d51b86d8e7a712_W553xH262.png

Suman Bhadra

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 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | Gautam | Cpp | 0.00s |

02 | astinaam | Cpp14 | 0.00s |

03 | JACKAL1586 | Cpp14 | 0.00s |

04 | mahbubcseju | Cpp | 0.00s |

05 | fsshakkhor | Cpp14 | 0.00s |

06 | njrafi | Cpp | 0.00s |

07 | Bruteforcekid | Cpp | 0.00s |

08 | I_See_You | Cpp14 | 0.00s |

09 | t0whid | Cpp | 0.00s |

10 | by_default | Cpp | 0.00s |

11 | Pure_Protea | Cpp14 | 0.00s |

12 | sahedsohel | Cpp | 0.00s |

13 | kzvd4729 | Cpp | 0.00s |

14 | shuvo_mbstu | Cpp | 0.00s |

15 | cre_ator | Cpp14 | 0.00s |

16 | the_badcoder | Cpp14 | 0.00s |

17 | Gang_Of_Three_01 | Cpp | 0.00s |

18 | hiddenhopes | Cpp | 0.00s |

19 | mamun4122 | Cpp14 | 0.00s |

20 | Zeronfinity | Cpp | 0.00s |

21 | Hasinur_ | Cpp | 0.00s |

22 | mir_sabbir | Cpp | 0.00s |

23 | pulak_ict_mbstu | Cpp14 | 0.00s |

24 | Rafiqul01 | Cpp14 | 0.00s |

25 | inception_h | Cpp | 0.00s |

26 | KM_Muntasir | Cpp | 0.00s |

27 | MohammadShamim | Cpp | 0.00s |

28 | feodorv | C | 0.00s |

29 | Silent_Warrior | Cpp | 0.00s |

30 | Code_Hunter | Cpp | 0.00s |

31 | Vasiljko | Cpp14 | 0.00s |

32 | fuckingfuckingff | Cpp | 0.00s |

33 | ehsan_sshuvo | Cpp | 0.00s |

34 | Durbin | Cpp14 | 0.00s |

35 | Zayed | Cpp | 0.00s |

36 | Rajib_119 | Cpp | 0.00s |

37 | Reayz | Cpp | 0.00s |

38 | ittehad | Cpp | 0.00s |

39 | tariqiitju | Cpp14 | 0.00s |

40 | prateepm | Cpp14 | 0.01s |

41 | zyyxxx | Cpp14 | 0.01s |

42 | ssavi | Cpp | 0.01s |

43 | Baka_Raffi | Cpp | 0.01s |

44 | rayhan50001 | Cpp | 0.01s |

45 | Fazla | Cpp | 0.01s |

46 | sparsheatu | Cpp | 0.01s |

47 | _c_k_r_ | Cpp | 0.01s |

48 | FariD | Cpp14 | 0.01s |

49 | Double_O | Cpp | 0.01s |

50 | mehedi_01 | Cpp14 | 0.01s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(