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