fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone{
  6. public static void main (String[] args) throws java.lang.Exception{
  7. double k;
  8. double d = 0;
  9. int b=1;
  10. Scanner x = new Scanner(System.in);
  11. int n=x.nextInt();
  12. for (int i=1;i<=n;i++){
  13. k = x.nextDouble();
  14. k/=b;
  15. b*=i;
  16. d+=k;
  17. }
  18. System.out.print(d);
  19. }
  20. }
Success #stdin #stdout 0.06s 711680KB
stdin
3	6 9 3
stdout
16.5