Guest User

Untitled

a guest
Dec 10th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n;
  8. int array[n+5];
  9. for(int i = 0 ; i < n ; i++){
  10. cin >> array[i];
  11. }
  12. int count = 0;
  13.  
  14. for(int i = 0 ; i < n ; i++){
  15. count = count + (4 * i * array[i]);
  16. }
  17.  
  18. cout << count << endl;
  19. return 0;
  20. }
Add Comment
Please, Sign In to add comment