fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner sc = new Scanner(System.in);
  9. double h = sc.nextDouble();
  10. double w = sc.nextDouble();
  11. double b = Math.max(h, w);
  12. double a = Math.min(w, h);
  13. double c = Math.min(Math.min(w,h), Math.max(b/3, a/2));
  14. System.out.printf("%.4f", c);
  15. }
  16. }
Success #stdin #stdout 0.08s 2184192KB
stdin
100 100
stdout
50.0000