fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. class Main
  8. {
  9. public static void main (String[] args) throws IOException
  10. {
  11.  
  12. int ile = Integer.parseInt(br.readLine());
  13.  
  14. for (int j=0; j < ile; j++) {
  15. int a[] = new int[2];
  16. String line = br.readLine();
  17. String[] s = line.trim().split(" ");
  18. for (int i = 0; i < 2; i++) {
  19. a[i] = Integer.parseInt(s[i]);
  20. }
  21. System.out.println(2 * a[0] * a[1] / (a[0] + a[1]));
  22. }
  23. }
  24. }
Success #stdin #stdout 0.06s 32828KB
stdin
2
50 50
60 40
stdout
50
48