Witam czy rozwiązywał ktoś to zadanie w javie: (http://pl.spoj.com/problems/VSR/) i mógłby mi pomóc z algorytmem, gdyż ciągle dostaje komunikat "Przekroczono limit czasu".
import java.util.*;
import java.lang.*;
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner(System.in);
int vs, v1, v2;
for(int t = in.nextInt(); t > 0; t--)
{
v1 = in.nextInt();
v2 = in.nextInt();
vs = 2 * v1 * v2 / (v1 + v2);
System.out.println(vs);
}
}
}