fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. double x, max = 0.0;
  11. int m = in.nextInt(), n = in.nextInt();
  12. for (int i = 0; i < m; i++) {
  13. double s = 0.0;
  14. for (int j = 0; j < n; j++) {
  15. x = in.nextDouble();
  16. s += Math.abs(x);
  17. }
  18. if (s > max)
  19. max = s;
  20. }
  21. System.out.println(max);
  22. }
  23. }
Success #stdin #stdout 0.16s 321280KB
stdin
4 5
1 -3 2 4 0
-3 -7.5 2.3 -3.1 2.8
3.4 -4.5 0 0 2
3.2 4.7 2.8 -3.1 -4.3
stdout
18.7