Test case 2 not passing in Quadratic equations

Kindly Check, Did i missed any condition ?

import java.util.*;

public class Main {

public static void main(String args[]) {

    Scanner scan = new Scanner(System.in);

    int a = scan.nextInt();

    int b = scan.nextInt();

    int c = scan.nextInt();

    int D = (int)Math.sqrt((b*b) - 4*a*c);

    int root1 = (-(b) + D)/(2*a);

    int root2 = ((-b) - D)/(2*a);

    if( D == 0 ){

        System.out.println("Real and Equal");

        int r=-b/(2*a);

        System.out.println(r + " " +  r);

    

    }else if( D > 0){

        System.out.println("Real and Distinct");

        System.out.println( (root1>root2?root2:root1) + " " + (root1>root2?root1:root2) );

    }else{

        System.out.println("Imaginary");

        System.out.println(" ");

    }

}

}