fork(5) download
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) throws IOException {
  7. int t = Integer.parseInt(load.readLine()) ; // number of tests 1-1000
  8. for (int i = 0; i < t; i++) {
  9. String[] temp = load.readLine().split(" ");
  10. int[] tabInt = Arrays.stream(temp).mapToInt(Integer::parseInt).toArray();
  11. float result = (float) ( (2 * tabInt[0] * tabInt[1]) / (tabInt[0] + tabInt[1]) );
  12. System.out.println((int) result);
  13. }
  14. }
  15. }
  16.  
Success #stdin #stdout 0.08s 34488KB
stdin
2
50 60
70 40
stdout
54
50