Help me in solving ICM2003 problem

My issue

Time Limit Exceeded

My code

import java.io.*;
import java.util.*;

class Codechef {
    static final double EPS = 1e-7;
    static final double PI = Math.PI;
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int T = Integer.parseInt(br.readLine().trim());
        
        while (T-- > 0) {
            String[] input = br.readLine().split(" ");
            double b = Double.parseDouble(input[0]);
            double c = Double.parseDouble(input[1]);
            
            double left = 0, right = PI / 2;
            while (right - left > EPS) {
                double m1 = left + (right - left) / 3;
                double m2 = right - (right - left) / 3;
                
                if (f(m1, b, c) < f(m2, b, c)) {
                    right = m2;
                } else {
                    left = m1;
                }
            }
            
            sb.append(String.format("%.10f\n", f(left, b, c)));
        }
        
        System.out.print(sb);
    }
    
    static double f(double x, double b, double c) {
        return (x * x + b * x + c) / Math.sin(x);
    }
}

Learning course: 2000 to 2500 difficulty problems
Problem Link: Is This JEE Practice Problem in 2000 to 2500 difficulty problems